Q would be one of the major reasons that the Federation won the Dominion War.
In the TNG episode "Q Who" Q introduced the Federation to the Borg, and said: "You're not prepared for what awaits you" and many people thought he was referring to future Borg encounters, but could he really have been referring to the Dominion?
In the episode "The Best of Both Worlds" Starfleet suffered the loss of over 40 ships to a single Borg cube and if they hadn't, Starfleet would not have started constructing more powerful ships and refitting current ones with better weaponry. So, the Federation may not have constructed the Akira Class, the Saber Class, the Defiant Class or the Prometheus Class and would not be prepared for the Dominion.
Perhaps there is like a sort of conference, with Q, the Prophets, the Organians and other species to decide the fate of the galaxy, and maybe the Prophets saw that at some point, the Dominion would attempt to take over the Alpha Quadrant and called Q to give the Federation a hint, a helping hand, so that the Alpha Quadrant would push the Dominion back to the Gamma Quadrant. It would be silly if the Q Continuum, the Prophets or any other god-like beings weren't aware of each other.
So, that's my theory. Hope you liked it!