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.
That's certainly how construction 'appeared' in Trek, but it simply doesn't make any sense.
A lot of construction work today in real-life can be easily automated (we won't talk about the financial ramifications though because this is a pure resource/technological thing separate from 'money' and cost).
Federation technology should be far beyond what we can do.
As for the Jem'Hadaar making the ships... doesn't make sense.
While I will accept the notion that 'some' things may require a humanoid interaction, they wouldn't involve actual building because they would be well beyond the level of tech necessary to do this.
Chalk it up to the writers dumbing everything down intentionally for the sake of drama - or because they simply didn't know any better (both apply to how they handled Trek on numerous occasions).