It was just a simple means of providing shorthand for the audience. "They have four pips on their collar, they're Captain." DS9 made an attempt to have officers lower than Captain in command. The Defiant basically is Worf's command, and he's Lt. Commander. Then of course, there's Dax taking command of the Defiant during the War, complete with the crew addressing her as Captain. Then there's the USS Prometheus from Second Sight which was commanded by a Lieutenant JG. Though, he was intended to be a Lt. Commander, costuming screwed up on his pips. Also, the episode's writer was under the impression the ship would be smaller than we saw on screen. On screen it was a Nebula class ship, which typically has a crew of 900, which should be sufficiently large enough to warrant an actual Captain to command. Just off the top of my head, the Oberth, Nova, Defiant, Miranda and Constellation classes are pretty small. Also, Voyager should only have been commanded by a Commander, given its crew of 150. Discovery too, though maybe in that case being an experimental ship and so vital to the war effort might have warranted an O6 officer commanding.