What Is the Purpose of the Military?

News that the military are going to have to postpone some of the most recent round of extravagant purchases of unneeded equipment, the question arises again as to what is the point of the military? What is it they are supposed to be for?
There is clearly a social role in providing employment to the lower classes, some of whom are happy to take the draft and have the chance to earn a trade (the draft is supposed to affect every male, rich or poor but the cost of having your positive result turned into a negative one is 30,000 baht, last time I heard. Or you can do the Abhisit/George W Bush thing and get your rich friends to give you a non-assignment which you can just ignore).
There is also the need to buttress the status and prestige of the huge number of generals and other senior officers and this is often achieved by the size of the budget concerned and the opacity with which it is possible to spend it.
What is the purpose of yet more jet fighter planes (apart from status and machismo)? Who else nearby has fighter planes – Vietnam? China? Singapore? If it comes to a war with any of these countries, then Thailand is already lost.
What is the point of another 89 armoured personnel carriers? For use on the Burmese border or to assist another coup?
What about the special budget request of 809 million baht for more anti-riot gear? This includes body armour, shields, electric batons and other weapons. Why is the army taking this role? Why not give the money to the police instead? Well, the Invisible Hand faction could answer that.
On the other hand, there are some genuine military roles which do not seem to be addressed: Thai troops can act as peacekeepers for the UN, which earns various diplomatic benefits – presumably such troops need supplies and equipment. There is a need to patrol the Gulf of Thailand to prevent (rather than commit) acts of violence against refugees and also to guard against pirates and smugglers – not sure whether jet fighter planes would help much there – as well as maintain order along the Burmese border. Helicopters would be helpful there, as well as spotting equipment, communications and control centres and the like.
Perhaps if Thailand ever gets a genuine, elected democratic government, then a proper review into military purpose and spending can be held in a full and transparent manner. Still, we saw in 2006 what happened when a democratically elected PM tried to weed out some of the bad elements in the military leadership and replace them with officers who might obey the government.