Galactic empires in media have undergone a steady progress of increasing the size of their starships. It's almost as if, in addition to the technological problems or space space travel, the ships have to look good on film as well. Regardless of this, huge government ships are here to stay. But, there are a few problems for would be dictators who want to build mobile moons.
Take the polities of Alpha and Beta, unoriginal but advanced worlds of equal engineering skill and resources. They both eye each other warily and then begin building ships for their defense a/o offense. Assume a flat cost per ton for military ships. Alpha decides on building a fleet of fast attack ships 100 meters long. Beta wants good photo ops for their glorious navy and builds their attack craft 200 meters long.
That's where the cube law steps in and starts to ruin things. A ship with double the dimensions of yours will be eight times the mass and eight times the cost. For the moment the Betans go with the larger ships.
Out of their available resources the Alphans build a navy of 72 ships. The Betans construct nine. Now a Beta cruiser is more than a match for an Alpha gunboat, correct? It depends. In terms of surface area the Betan ship has four times that of an Alphan ship and can mount four times the weapons.
Or can it? The Beta ship needs larger engines, it's pushing eight times the mass and those glowing panels movie ships use to move take up surface area too. On a Beta ship they will have to be eight times the surface area of an Alpha style engine. That means they are 2.8 times the length and width of the engine panels/thrusters/whatever of the Alpha ships.
So instead of four times the area, say a Betan ship has three times the area to mount weapons. That means for every eight weapons the Alpha fleet brings to the party, the Betans will bring three. Assuming there's an equal amount of tonnage.
What about flexibility? Say both empires have 18 worlds to protect a/o invade. The Betans will have to shuffle their nine ships around to prevent rebellion, deal with pirates, and show the flag to keep the Alphans honest. The Alphans could keep four ships at each of their worlds, maybe get away with two ships and have a mobile reserve or attack force to keep those ships from Beta honest,
In contrast, in the event of hostilities the Alphans could match the Betans in weapons using 24 ships of their fleet, and use the other 48 to attack and out gun the big ships. Moreover those 12 of the Betans worlds without protection are going to get awfully angry and might rebel or secede.
So it looks like the guys with the bigger ships are going to lose. What are some reasons for building those lovely, gargantuan ships we all love?
First of all, resources, technology, and missions might not be equal. The first example that springs to mind is the Trillion Credit Squadron GDW loved to organize. Your humble author had the distinction of playing in the first tournament GDW held at GenCon. Never mind how long I lasted! In TCS you had a fixed number of pilots which put a cap on the number and size of ships you could build. personnel are a very valuable resource, you can't train them overnight, and they might have other plans (like joining the Resistance!) Don't forget some of those pilots or whoever are needed to provide civilian shipping.
Star Trek:TOS had dilithium crystals. they always seemed to be in short supply. Even t he Enterprise never had any spares on board! This being the case yes, you bet you'd build big ships and get the most of a scarce resource.
If your empire uses star gates of some sort then the 'resource' is how much mass a gate can move. Again you might want to consider that a limit on ship size.
A navy designed to protect against pirates and other naughty types might run towards small ships, even smaller than the average pirate in order to be more places and swarm. the odd corsair they find. A culture with little or no piracy might run towards large ships to do tasks the smaller locally built vessels couldn't. When war threatens you go ahead with the forces you have.
Say the Betan Republic was a stable, secure and friendly power for years. With little or no piracy, their 200 meter ships were more a deterrent than anything else (but very good at that). The Betans have a revolution and become the Evil Empire of Beta. The overlords begin a crash ship building program (no pun intended) but for now their evil schemes are limited by their monstrously huge ships. The Alphans seeing the handwriting on the hulls decide to declare war.
Scale efficiencies are another, important factor. In my simple and naive example, we were talking a fixed cost per unit of ship. What if say, larger engines were more efficient, cheaper per ton or more powerful? It might be cheaper to build bigger engines for bigger ships, it might be impossible to build them small. In Traveller you have the minimum size of 100 tons for an ftl capable ship. It could be a lot more than that in some settings.
What about endurance? People do not often consider the cargo capacity or a warship. A ship's cargo hold contains the things it needs t complete a mission, whether that is hauling freight to remaining on station for weeks and months. If the Alphans have eight times the number of Betan ships but they have only half the supplies, then you'd have less of your fleet on station while the rest is heading back to starport, getting resupplied or heading back to station. Or we have to pay extra for supply ships that can be attacked and will require defense ships.
For our example, I've kept weapons simple and ignored defense. In reality a bigger ship will probably want to mount a few bigger guns that smaller ships couldn't spare the space for. To continue our example, the Betan ships would have armor twice as thick as the Alphans. A Betan ship could defeat several enemy ships at once meaning attack forces would need to be built around several Alphan ships and cutting down on the flexibility of the Alpha fleet. A single Betan commerce raider that got past the defenses would raise a huge ruckus and draw many ships from their missions to track down and eliminate it. Moreover some weapons might be more dependent on volume than the size of their launcher. A really big laser could be mounted in the hull with a mirror in a comparatively small turret to direct it. Missile launchers need cargo for their ammunition and of course the spinal weapons beloved of Classic Traveller and anime take up a huge amount of internal space.
As a final note: larger ships have more room for force multipliers. Classic Traveller excelled at this with the concept of battle riders. Basically ships carry smaller ships, fighters, missile buses and whatever to increase their firepower. If instead of building eight 200 meter cruisers the Betan build four and each of them carry four 100 meter ships well hey! -You have the same surface area as the Alpha fleet for mounting weapons and you have several ships with larger weapons and thicker armor to base your task forces around.