I had a theory on why the Dominion could build ships faster than the Federation. The Jem Hadar are building the ships.
It's part automated, part labor.
They don't need sleep or food, so they are available at all hours of the time to build ships. Since Jem Hadar can be replaced easily in a matter of days, the ship building doesn't stop.
True, in the 24th century automated factories could exist, but there has to be a lot manual labor involved in assembling these ships.
Maybe the Federation kept building their ships the same old way, and was completely caught off guard when they came across the Dominion's way of building ships.