Well, the feudal model was based on a heirachy of protection and allegiance. The serfs farmed the land and gave stuff to the heavily armed guys because they would get protection from Vikings or the heavily armed guys in the next district. Of course, soon the heavily armed guys began to think that they were owed this kind of treatment. After a few centuries, the French Revolution came along.
But yes, the tax money largely goes to protection, public works and the enrichment of the Grand Poobah (king, emperor, whatever). Roads were built so you could reach the landing Vikings more quickly on your horse. Walls were built around villages so your serfs stayed alive (they're the ones who kept you fed).
In a fantasy mileau, however, you've got to consider magic and monsters. Now, some might say magic would greatly improve the lot of your common peasant - cheap lighting, instant transportation if you can afford it, that sort of thing. I disagree. In my campaign, I've limited 'common' magic to resemble the technology of the time. Magic Missile is simply a replacement for bows (still doesn't need to roll to hit, though), and Fireball is only known in far distant lands (like China, because they had gunpowder). More powerful spells are completely unknown, and planar theory is centuries away from the common scholar. In fact, I've weakened some spells so Continual Flame only burns for a few days before it 'breaks' and dissapates.
This doesn't mean that there's no useful magic, however. A low-level mage can be very useful in industry; they can create intense flame or intense cold, repair simple objects with a few words, lock doors or grow items to a great size - all at first level. IMC, there are a few low-level mages in each city working with blacksmiths, artificers and scholars.
The Church, which recieves copious donations and income from owned land, is supposed to improve the lot of the poor, but doesn't always do so. They're building a new Cathedral instead. However, priests are officially supposed to offer their gifts to anyone in need. A sick peasant can show up and request a cure, and if they don't have someone with Cure Disease memorised they can give him a cot until the morning. There is little money for the common peasant, but they do get the occasional benefit.
Monsters, now. Monsters and evil overlords are common in fantasy worlds. You need a strong military to fend off goblins and orcs, which is a good investment of tax and tithe. Bigger monsters are more troublesome. This is why the Grand Poobah keeps a reserve in treasury: to hire adventurers to Slay The Dragon, because a hundred common soldiers couldn't put a dent in its hide before being burned to a crisp.
I don't know the exact proportions of funds allocation. I'd guess ten percent at least goes to the Grand Poobah's personal funds, and the rest is spent on protection, upkeep and hiring adventurers.