Odo ends the war by being the most Starfleet-esque person in the show! He reaches out and shows compassion for an enemy, conquering the enemy by making her a friend.
That was a nice ending, but completely implausible. The Female Founder was a ruthless genocidal maniac throughout, but what she really needed all along was a hug. What baloney.
DS9 generally gets high marks for earning
its dramatic twists and not asking the audience to accept implausibilities just because the plotline needs them to, but that wasn't one of DS9's better moments in terms of writing.
It's obvious that what happened was, the series was ending and the writers needed to wrap things up in a way that didn't a) have the Federation lose or b) have the Federation win by doing something awful. Trouble is, they'd written themselves into a corner by that point and option c) - do something implausible that the fans can't complain about because it's over and it's too late for complaints - was the only alternative left.
You could also argue that they really chose b) anyway. The Female Founder would have never given in simply because of Odo's, or anyone's kindness if she hadn't been severely weakened by the S31 disease.