Clearly Starfleet seems to be the largest economic power in the known galaxy and often a large economic power can overwhelm a superior military force through sheer numbers, technological advances and alliances. Which seems to be what happened here.
No what happend was the dominion fleet got cut off and had to reley on a 3rd rate power to maintain it.
If the wormhole had been avalible then it would of crushed the Alpha/Beta quadrent races like insects.
The most powerfull in the milkyway is the Borg. I dont think you can deny that. But the Domnion is deffinatly above the Federation.
Quite frankly though there are vast unexplored areas of the mikyway the dominion were only stmbled on by chance. There may be some other powerfull empires out there.
I also think the Krenim from voyager would have been able to go toe to toe with the Federation.
I suppose the whims or the writers supercede what would seem to be logical. However, unless I am mistaken in thinking the Federation to be the superior economic power, the advantage the Dominion had was in their war footing (production of military assets) and the ready availability of Jem Hadar soldiers (who were both numerous and disposable).
The logical counter to this (as expressed in another thread) would be for the Federation to not only gear up for war production (total war) while using AIs and unmanned assets to do the majority of the fighting. This would also increase productivity as ships could be much smaller and efficient (no need for crew areas). The downside is these ships would be useless for other uses outside of the war. But if the existence of the Federation was truly threatened then survival and victory would be more important than balancing long term value for current resources.
But hey, the Federation always seems to develop some super new technology or find a new super-race to ally with that we might have to take into account. Maybe its more than luck, maybe its cosmic karma that rewards the good empires. ;-)
To do a true analysis we would need to know more about the Dominion's and Federation's overall resources. One race could be constantly on a war footing and thus have a huge advantage at the beginning of a conflict while another have greater overall resources that, once tapped into, would become overwhelming in the long term (similar to the US in WW2).