One day, my high school history teacher was talking to us about WWII and the men in the trenches. It isn't a scene from the trench warfare but if you've seen the Omaha Beach scene from Saving Private Ryan  you can get an idea of the kind of indiscriminate mass slaughter people experienced during that war.
The question came up, how did they manage to get up when so many bullets are flying through the air? What goes through a person's mind to allow them to hop up, out of the relative safety of the trench, and run into oncoming fire?
He hadn't personally fought in the war, although we joked that he was old enough to have done so, but he had spoken to veterans who had.
When you got into that situation you stopped thinking about yourself, you thought about your comrades instead. This train of thought also gets touched upon in Mark Bowden's book, Black Hawk Down, which is a good read for any of you interested in some non-electronic entertainment haha.
He also told us that what really kept you throwing yourself into the line of fire was the fear of shame. You didn't want to be the one who sat down and let everyone else do the fighting.
That comrade-in-arms brotherhood... I think a lot of people have lived their entire lives without ever feeling that kind of 'my life in your hands, yours in mine' sentiment. I mean really felt that, not just a close friendship or something close to it.
I attribute the appeal of being a soldier to this lack. You really feel like you're a part of something bigger than yourself. That something, someones, are relying on you. Life and death. Not dollars and cents.