No offense at all! In fact I used to think the same thing about the Cardassians-that they were militarily much weaker than the Fed.
Then I saw some things on DS9 that made me see it another way. I'll explain in a few points;
The Cardassian military is very organized- it's large enough that they have it arranged in Orders or fleets. They also have the capacity to build a number of space stations and ship yards.
Gul Dukat seemed capable of directing and winning the war from the station during the war.
Their scientists are very intelligent. They figured out how to remove the minefield. They developed super weapons (on their own) that were effective.
They designed a drone that was nearly unstoppable, and the Orbital weapons platforms that nearly wiped out a combined Allied fleet.
I realized that they have a strong system of organization and discipline that could make them a serious threat.
I'll admit, the problem is, their ships are outclassed by the Federation, and Cardassia is smaller in size than the Federation. Their economy is weaker and dependent on strip mining of other planets. (They also have a brutal self defeating philosophy)
The Fed had a tech advantage. and a much better head start on them.
However-if the Cardassian Union were larger, had more ships, and updated tech, and they had the same system of organization that they had before the war, they would have been a much, much more dangerous match for the Federation.
That's like saying if Germany had more planes, tanks, oil and men, they would have won World War II. Sure it's true, but it doesn't exactly mean much.
Cardassia was advanced enough to compete with the great powers and be acknowledged by them, but not really enough to be truely threatening. Most of their greatest schemes involve tricking and outmanuvering their opponents.
Dukat wasn't a threatening villain because he had a huge fleet as his command, but because he was so unpredictable he kept the good guys guessing.
Their scientists were very capable. Damar personally brought down the minefield and those Orbital Defense Platforms would have been far more threatening if they didn't have such an exploitable flaw. Apparently it was corrected being we saw a series of those platforms deployed around Cardassia in What You Leave Behind.
But after all the Klingons brought the Cardassians to their knees fairly easily, they never were able to hunt down a terrorist group like the Maquis and you get the impression during that first war with the Federation, the Starfleet was fighting more a war of containment and checks than actually trying to beat them.
They are a capable power, but short of dramatic shifts of power like them joining the Dominion, they weren't going to be truely threatening.