In The Pale Moonlight takes place during the Dominion War, which is going very badly for the Federation. They are sustaining terrible losses and all forcasts have them losing to the Dominion and their allies. During a discussion over the latest casualty list it's speculated that the tide could turn in their favour if they could convince the Romulan Empire, which has so far remained neutral, to ally themselves with the Federation against the Dominion forces. Determined to bring this about, Sisko consults with Elim Garak, Cardassian tailor/ former spy. Garak tells him that he can manufacture evidence which will make the Romulans believe that the Dominion is planning to break their truce and attack the Romulan Empire. Desperate, Sisko agrees to go along with this plan, though Garak warns him that it's likely to be a dangerous, bloody business. His words prove prophetic and Sisko finds himself getting in deeper and deeper, morally compromising himself and unable to pull back as the situation spirals out of his control. When a Romulan ambassador is assassinated and all evidence points to the Dominion, a horrified Sisko realizes that Garak arranged the murder to implicate the Dominion and bring the Romulans into the war. He confronts Garak, who basically tells him that you can't make an omlette without breaking a few eggs and bluntly points out that this is why Sisko came to him: because he could do things Benjamin couldn't/wouldn't do.
The episode's plot is related by Captain Sisko in a series of of flashbacks as he records a personal log, confessing in it- before he deletes it the post-his culpability and moral failings. Ultimately he concludes that, as ethically wrong as what he participated in is, it succeeded in bringing the Romulans into the war and therefore he will swallow his shame and guilt and learn to live with what he's done. He erases the personal log.