Would a Federation warship like the Defiant out gun a Star Wars Star Destroyer? Who has a bigger armada? Who has the tactical advantage? Don’t forget that The Federation includes the Klingons, who love warfare and have fast, agile, heavily armed ships, with cloaking devices, and the Vulcans with superior logic and tactical planning.
They work by assembling atoms into their respective molecular structure to produce materials. Think of them as very fast atomic 3d printers. They have devices on-board that break matter (any matter) down into the building blocks for atoms (quarks, electrons, neutrons), and then that resource can be re-assembled in whatever configuration is requested. You can turn poop into whiskey with Federation technology.