Part of it has to do with discipline and learning the "internals" of our mind and body, but probably the greatest element has to do with learning how to deal with our fears. There is a story about the Mongols invading a Chinese Zen Temple and an officer raging into the meditation hall where he met the Master sitting in a lotus posture. When he simply sat without showing any signs of fear, the warrior yelled at him "Don't you know that before you is a man who could kill you without blinking an eye?" The Master's response was "Don't you know that before you is a man you could kill without him blinking an eye?" Since the officer valued courage, he decided to spare the monk's life and left the hall.
Zhuangzi makes a similar point in several places. For example, he describes an archer who is capable of always hitting the target until he is standing on the edge of a cliff at which point his fear of falling destroys his aim. He also makes the point that the secret of learning how to be good with a boat is to become a good swimmer---at which point the boatman no longer fears falling in the water.
For most people fear is an existential issue. But for soldiers it is a very practical problem. Most people probably don't realize this, but for most of human history courage has tended to be one of the most powerful weapon in a soldier's arsenal. That is, all other things being equal (which, admittedly, they often are not), the most brave side almost always won the battle.
This was because a man who is running from battle is a lot easier to kill than one who is facing you head on. And a body of men who is standing shoulder to shoulder can count on each other to guard their flank. Men who cannot trust that their neighbour will protect them, cannot focus completely on their enemy and will be easier to kill. Indeed, in most ancient battles where great slaughter occurred, it did not happen when both sides were facing each other in battle but after one side had turned tail and was trying to run away.
So the practical paradox of warfare is that the man who is least afraid of dying often has the best chance of not dying at all.
There is a story in Japan that the leader of the military force that repulsed the Mongol invasion, Hōjō Tokimune, meditated to overcome his fear in order to lead the battle.
Tokimune was overcome with fear when the invasion finally came, and wanted to defeat cowardice, so he asked Bukko (his Zen master) for advice. Bukko replied he had to sit in meditation to find the source of his cowardice in himself. Tokimune went to Bukko and said: "Finally there is the greatest happening of my life." Bukko asked, "How do you plan to face it?" Tokimune screamed "Katsu!" ("Victory!") as if he wanted to scare all the enemies in front of him. Bukko responded with satisfaction: "It is true that the son of a lion roars as a lion!" Since that time, Tokimune became instrumental in the spreading of Zen Buddhism and Bushido in Japan among the samurai. (Wikipedia)
Warfare has changed dramatically since the age of Samurai, but the control of fear has continued to be a significant issue in warfare. The modern approach is to use intense training experiences (i.e. "boot camp") to raise recruit's confidence level both in themselves and their group, which in turn develops a sense of group identity and loyalty to the regiment. This trains men to put the good of the group ahead of the individual. The result is very different from Zen meditation, which is very-much focused on individual insight. But it is something that can be mass-produced and which produces very predictable results. It doesn't create "realized men", but the sense of solidarity continues long after military service has ended---which is what sustains veterans associations.
Where meditation's work with fear can still be of value, however, is in helping people deal with the terrors of everyday life.
And I use the term "terror" advisedly. Our modern lives are so complex and unpredictable that many of us find it pretty much impossible to maintain any sense of "comfort" for any length of time. People who are losing their jobs; who have to constantly adapt and retrain in order to stay employed; who live from contract to contract; who live in rough neighbourhoods; who have loved ones falling on hard times; who's life is dependent on complex, constantly changing, poorly understood technology; the complex interpersonal dynamics of the workplace----all of these can create the same sort of "organized chaos" that soldiers experience on a battlefield. Add to this a never-ending sense of impending social collapse due to things like global warming, peak oil or the economic collapse we are currently living through.
While the intensity of this stress is less than that experienced by soldiers, it's duration goes far longer. And just like soldiers, ordinary people only have a limited supply of courage to draw upon. Take too much out of the reserve, and even the most stoic will eventually collapse into quivering blobs of terror---sometimes for seemingly very trivial reasons.
I remember seeing a couple aquainences who had lost their last reserve of courage. These were both men who were extremely "macho" and who took great pride in living very independent lives and doing extreme work. Ordinarily, I suspect that they would be considered extremely brave men. They undertook to grow a large amount of marihuana to sell for easy money. Unfortunately, things didn't work our well and one of them was arrested and the other was terrified that he would be too. They both totally "lost it". Every last scrap of stoicism disappeared and they both descended into absolute terror. In a sense, I was watching the civilian equivalent of "battle fatigue".
And I have to admit that I too fall prey to the terror of modern life. It isn't so much that I am facing huge stressors (I've been pretty good at protecting myself), but the day-to-day struggle of having to constantly be at the mercy of other people and technology I don't understand sometimes wears me down and fills me with a vague, unending, existential dread.
And the only thing that I've found that can sustain me is to sit on the pillows and meditate---just like Hōjō Tokimune when he faced the immense might of the Emperor Kublai Khan. I may not have faith in myself anymore, or the world around me, but at least I still have some faith in the practice of meditation. I hope that this life-raft will take me past this current existential problem and carry me forward into some better place.