This may be a stupid question but I feel like I always see stats from wars where the country may have millions of men in the army but still only commit a very small percentage to a frontline in a war. Why is this? Logistics? Covering other countries frontlines? I'm interested.
This is a good question.
First I'd like to get something out of the way : despite the number of people being part of the military that can be announced by a country, actually a lot of them are not part of the fighting forces. The military offers a lot of jobs that never see the Frontlines : supply handler, intelligence analyst, computer programmer... Working for the army can be hardly different from any other office job.
Seconds, even among those who may see the Frontlines, modern armies have a lot of support jobs : engineer, mechanic, medic, cook, communications specialist, reconnaissance analyst. .. That are necessery for the "directly" fighting forces to be able to perform optimaly, but they weren't train to be an active part of combat, at best a support.
Third, in a way your question can sound a bit like "why won't an electrician use all of his tools during a single job?". Modern armies comprise heavily specialized units : cyber warfare units, combat divers, parachutists, mountain fighting units, submarines, special forces... Such units have very situational use and perform very well in the adapted context, but a country will hardly use combat divers and submarines in Afghanistan, mountain forces in Ukraine, tanks in the dense forests of Vietnam fighting against lightly armed rebels, special forces in a direct face-off between two large armies... All these units will not - or hardly - be engaged during certain wars because it is not the setting in which the were made to perform. You could argue that they could be, but they would typically perform worse than adapted units who went through a training adapted to the situation, so it's not an optimal play.
Fourth, as you said there is a matter of supply lines. Once you enter an opex, you have to establish supply lines for food, ammunition, equipment, repair parts, soldiers going back and forth... This is complicated as modern armies do not travel light - you typically have to do it via plane, it's complicated logistics and it's very expensive. It is generally admitted that there are only a handful that have the capacities to deploy their army anywhere in the world - the US, France, the UK. Russia's capabilities to do so have come into question in the last few weeks, but whether or not they still make it on this list is not the debate. Anyway. It's a logistics nightmare, it's crazy expensive and it requires a know-how that comes with a lot of time, military culture and investment. Most countries will limit themselves to engagements close to their home bases where supply is less complicated - but supply remains one of the keys to the doing or undoing of a military operation. Since it's expensive, you don't want to send tens of thousands of soldiers - also, modern military operations tend to hit diminishing returns with the number of soldiers rather quickly. So it's wasteful to overdimension you operation, you will have experts who will, before the deployment, discuss the objectives of the operation and evaluate the number and types of soldiers that should be deployed. Having troops to spare also allows you to set up a rotation with fresh troops - war is tiring both physically and mentally.
Finally, you will typically have several bases during you operations. These bases, which can be at various distances from the Frontlines, will be there for the housing of soldiers, the storage of food/repair parts/equipment, and will be the daily workplace of all your non combatant personnel. So you do not want to commit your whole forces on the front, only to have a small force rushing your base to destroy you reserves and kill/capture your supporting personnel. So you will leave some of your combatants to protect the base (also this allows you to setup rotations between high intensity and low intensity combat and not exhaust you combatants too quickly). Also from a strategic standpoint, any force on the ground has a likelihood of being completely wiped (the French at Dien-Bien Phu is a good example of how even a large army corp may be ambushed and chipped at into oblivion), so you never want to overcommit your forces in a way that would allow the adversary to inflict losses that would greatly hamper your capacity to pursue the war. Wars are won by the one whittling the enemy's willingness to fight the fastest. If your public only sees a money sinkhole with no results to show for - except for a procession of caskets coming back home, it's going to question its leadership. Wars are, after all, highly political.
So there you have it, I tried to be as exhaustive as I could, the tl;dr is because it's far from an optimized way of doing warfare