It also always amazes me that armies would march 50,000 or a million at a time even thousands of years ago, with much less technology, no vehicles, pack animals limited more by geography, less options for long-lasting food, and smaller populations. How did ancient man afford to be able to war when it probably cost their societies quite a bit?
The bolded part above is probably the mistake you're making here. Ancient societies weren't necessarily as small as you might be led to believe. Rome had a population of ~1 million - giving it a denser population than most large cities today. In the mid 14th Century France had a population of over 20 million.
In addition, in these ancient societies it was typical for
every single adult male to serve in the military. That might be from the age of 16 or even younger.
Thus, the actual number of military personnel an ancient society could mobilise would commonly dwarf the military capability of a modern country.
Australia - a country of 22 million - has a military force of less than 75,000. Two thousand years ago, Rome had less than 1/20th the population, but routinely fielded as many soldiers
in a single battle.
And it's worth pointing out only a fraction of Australia's 75,000 troops would ever be expected to be in actual combat, whereas Rome's soldiers pretty much all fought.
The big difference is that in those days warfare was about
conquest. Not only did you have free rein to steal whatever you wished from your foe, but more often than not you got to keep their entire territory. The benefits of warfare were therefore enormous. A single decisive victory could secure for your state vast regions of land with all of the resources they contained.
In contrast, since the 19th Century warfare has been less about conquest and more about solving political disputes between nations. In fact the laws of war today explicitly forbid victorious nations from seizing the wealth of their foes.
Thus the financial benefits of warfare today are pretty insignificant - even if you're fighting a country rich in a valuable resource such as, oh I dunno, oil?