There are three division in Starfleet as evidenced by the three uniform colors: Command Red (Gold in TOS era): Command decides what to do Operations Gold (Red in TOS era): includes security, operations and engineering. In the greater sense Operations means accomplishing that which Command decides, so it includes scheduling, and keeping things safe, running, and working. Science Blue: includes medical. Science is science. It means acquiring and using knowledge. So (TNG-era) red for commanders, captains and admirals makes sense: their job is to decide what the missions are and what the crew should do to accomplish the mission. Helmsmen and "the conn" are generally manned by junior officers in red (TNG era). This makes sense because they are carrying out orders and "commanding the ship". But there are junior officers all over the place in red (TNG). They are obviously not making decisions and giving orders all day long. And there clearly don't need to be very many helmspeople on the ship. What jobs do all these officers in red have? (TNG era -- for TOS era, read as gold) Edit for visibility: Everyone seems to be pointing out the things they have seen them do. Helm, escorts, bridge relief. Possibly, 'lesser management tasks'. But none of these assertions explain how there can be so many of them. It would require only a few officers out of a crew of a thousand -- maybe a hundred -- especially since we know that most management personnel in ops and science are wearing gold or blue uniforms. If it was like people are saying, you would expect the sight of extras in red to be relatively rare. If we have no in-universe explanation, okay -- that's an answer.
Memory Alpha suggests that some command staff are adjutants, whose job is to help carry out the orders of more senior commanders. This could involve all sorts of tasks, but in crews of hundreds commanded by a small group of ten or so on the bridge that makes sense. Sort of behind the scenes staff.
Also from Memory Alpha:
During the original series, command gold... was also seen on phaser room ordnance crews, with some exceptions.
I think this illustrates that they were given somewhat lesser organisational tasks. This does not sound like a tactical role as much as an almost clerical task.
It also, on a side note, says:
An officer who belonged to the command division sometimes wore the division color of another department in which they specialized if said command officer became a security chief, engineer, or commanded a science department.
So perhaps personnel such as Tuvok, La Forge and Bashir (for example) are actually command staff wearing the uniform that shows what it is they command. (This doesn't really answer your question, but it intrigued me).
From TNG:Lonely Among Us:
LAFORGE: So, Worf, why the interest in this? It's just routine maintenance on the sensor assemblies.
WORF: Simple, Geordi. Our Captain wants his junior officers to learn, learn, learn.
At least under Picard, the junior officers are charged with increasing their knowledge, presumably to make better senior officers of them one day. At this point, Worf is learning to command. One aspect of command is a highly generalized knowledge of ships systems and procedures; command may be the "default" track for a junior officer who hasn't yet developed a specialization.
They have number of roles
Memory Alpha explains some of this (emphasis mine):
The command division was the corps of officers within Starfleet who specialized in command and control functions on starbases, aboard starships, and at Starfleet Command. Members of the command division were trained in leadership and had tactical training allowing them to decisively take action in organizing and mobilizing Starfleet crews to perform missions.
So, we know that we've got backups in case the chain of command collapses for some reason. The rest of the excerpt it much more important regarding this question though:
Command officers included most all of the admiralty, captains, executive officers, adjutants, pilots, and flight controller (or helmsman). Command division personnel also filled posts as tactical officers and sometimes in ordnance departments.
Remember that Tom Paris wore the red uniform, as did all helmsmen (and women) aboard the Enterprise-D. So that confirms at least one other role for command division officers.
As for those in ordnance departments, I take it that the question is referring to TOS onwards and, according to the previously linked Memory Alpha page, this department no longer existed on starships from the 22nd century onwards.
Looking at this page on Memory Alpha, in TOS, some of these roles, not already mentioned, included:
- Communications Officer
- Assorted Bridge functions
- Being present at Kirk's memorial service or weddings (some literally aren't seen apart from then!)
- Submitting reports to senior officers (presumably they were the head of a certain department)
- Escorting bridge crew to sickbay
- Shuttle pilots
The rest get probably get transferred
This still isn't a huge number of roles, so I would expect that the lower-ranking command division personnel are frequently transferred. Think about the changing helmsman aboard the Enterprise-D: they frequently change. In TOS aboard the Enterprise under Kirk we also see that the navigator's position changes regularly (there were at least 7 other than Checkhov).
But there are junior officers all over the place in red (TNG). They are obviously not making decisions and giving orders all day long. And there clearly don't need to be very many helmspeople on the ship.
First, are you sure all those people are officers? As I remember, the TNG uniforms didn't distinguish between officer and enlisted ranks all that well (unlike TOS). O'Brien wore the same style uniform as everyone else and had two pips on his collar, even after they started referring to him as "Chief".
However, it must be acknowledged that Starfleet is lousy with officers, way, way, way more than are necessary to manage any boat (inspiring a joke in ST:There Be Whales Here). Many of the tasks we see officers doing in Star Trek (like actually driving the boat) would be done by enlisted personnel in the Navy. Even a ship as big as the D shouldn't need more than a few dozen officers to manage1
So, this is speculation, not an authoritative answer, but I think it's reasonable: all those juniors are rotating through different departments for on-the-job training, and for administrative purposes they're all in the "command" division until they receive their permanent assignment (which may not even be on the Enterprise), at which point they wear the color of the division to which their department belongs.
Going to try to make this clearer. Again, this is not an authoritative answer, just speculation going by what I understand about shipboard organization in the present-day US Navy:
Shipboard organization is broken down into multiple departments - Engineering, Medical, Deck (maintenance of non-engineering systems), Operations, Administration (even the 24th century needs paper pushers), Supply & Logistics, Weapons & Tactical, Communications, etc.;
Each department has a department head that's a senior officer (Lt Cdr, Lt), and they report directly to the CO (or XO - depends on circumstances, I think);
Each department head would have at least one assistant (Lt or Lt jg), plus maybe a couple of junior officer direct reports;
Rounding out the department would be chiefs, petty officers, and crew who do the actual work2.
Junior officers would rotate through various departments over time, picking up OJT by shadowing officers permanently assigned to that department. They would probably spend most of their time writing status reports and doing other administrative scut work. They may have a couple of enlisted direct reports that they get to boss around.
So, who are all the damned redshirts running around the D? I suspect the majority of them are enlisted (who work in the departments that would logically fall under Command like Navigation, Operations, etc.). Again, the TNG uniforms don't distinguish between officers and crew all that clearly. You'd have the Command department heads and their assistants.
The rest are a gaggle of ensigns and lieutenants jg who are picking up training in various departments, but for administrative purposes are assigned to Command (maybe so the XO can review their performance and decide on their permanent assignment).
Again, pure speculation, not based on canon.
1. When I take over the franchise, the majority of major characters will be chiefs and petty officers
2. All those times you see Scotty climbing around the Jeffries tube, or Spock rewiring his own console, or Kirk helping bring the Constellation back to life? Yeah, doesn't usually happen that way. Officers give orders; enlisted execute orders.
Command division is like an officer corps. So they're similar to commissioned officers in the military (though most analogous to the unrestricted line officers). In the civilian world, they might be akin to people who've chosen a management track instead of an engineering or other technical career tracks.
For example, in the software industry you might have technical and creative leads in charge of various engineering and creative teams, but they often report to a project manager who has some familiarity with these various departments but specializes in management and is in charge of reporting to stakeholders and higher ups. A starship would need similar glue personnel to manage cross-functional units/operations.
In canon, command division officers don't actually wear red all of the time. E.g. if they're assigned to head up security or engineering, then they'd wear a gold uniform; or if they're leading a medical or science unit, then they'd wear blue.
I question whether 50% of the crew on a starship wears red. It seemed to me like operations gold was the most common uniform color. Red might feel more common simply because it's an eye-drawing color and there's an overrepresentation of command division personnel in senior ranks, who are more likely to be involved in key events or show up in frequently depicted key locations like the bridge.
As opposed to simply spending all of their time "learning," most would likely be handling administrative tasks and other command-related support tasks as they work their way up to the captain's chair and, hopefully, one day the admiralty. Some of the lower ranking officers might be administrative aides, serve as bridge personnel (duty officer, conn officer and man other command support consoles), support command activities like drills and crew evaluations, plan/lead away missions, provide support for diplomatic missions, serve as envoys in side missions to other civilizations/powers, help coordinate with other ships and non-Starfleet entities, serve as liasons for visiting dignitaries/VIPs, etc.