Hobbits seem to live a very rich, upper class life in the most peaceful landscape in the Middle Earth.
How do Hobbits come to be so rich when they don't seem to be doing any hard work?
I doubt most Hobbits would consider themselves rich. After all there were many with menial or only semi-skilled jobs. The Gaffer and Sam were gardeners, we see mill owners and a strong farming sector:
They do not and did not understand or like machines more complicated than a forge-bellows, a water-mill, or a hand-loom, though they were skilful with tools.
Their physical professions included:
millers, smiths, ropers, and cartwrights, and others of that sort;
The Baggins were rich, but they were what would be the aristocracy - plus Bilbo's gold from his travels didn't hurt. The Tooks as a whole were rich but lived in a very large communal area and an individual Took would not be rich by any means:
Sometimes, as in the case of the Tooks of Great Smials, or the Brandybucks of Brandy Hall, many generations of relatives lived in (comparative) peace together in one ancestral and many-tunnelled mansion.
There were indeed poor Hobbits:
Actually in the Shire in Bilbo's days it was, as a rule, only the richest and the poorest Hobbits that maintained the old custom. The poorest went on living in burrows of the most primitive kind, mere holes indeed, with only one window or none; while the well-to-do still constructed more luxurious versions of the simple diggings of old.
But in general Hobbits as one were well-off because of the riches of the land where the Shire was:
the Hobbits had again become accustomed to plenty. The land was rich and kindly, and though it had long been deserted when they entered it, it had before been well tilled, and there the king had once had many farms, cornlands, vineyards, and woods.
Overall there was a strong sense of community that meant supporting and providing for others, which would have lent itself to the concept of sharing wealth as needed:
Their faces were as a rule good-natured rather than beautiful, broad, bright-eyed, red-cheeked, with mouths apt to laughter, and to eating and drinking. And laugh they did, and eat, and drink, often and heartily, being fond of simple jests at all times, and of six meals a day (when they could get them). They were hospitable and delighted in parties, and in presents, which they gave away freely and eagerly accepted.
A stable civilization and strong familial bonds also aided the idea of providing for others:
The Hobbits named it the Shire, as the region of the authority of their Thain, and a district of well-ordered business; and there in that pleasant comer of the world they plied their well-ordered business of living.
Families for the most part managed their own affairs. Growing food and eating it occupied most of their time. In other matters they were, as a rule, generous and not greedy, but contented and moderate, so that estates, farms, workshops, and small trades tended to remain unchanged for generations.
So basically Hobbiton and the Shire were almost a utopia. Well-meaning and well-intended, food and other necessities were provided for by the strong family bonds should someone fall on hard times (witness Frodo's adoption by Bilbo as another example).
All quotes taken from the prologue of the Lord of the Rings.
The economic system of the hobbits was probably must more like Distributism, the economic system that boils down to everyone who can owning 3 acres and a cow. It's the natural economic outshoot of Catholic social teaching of subsidiarity. And Tolkien, being a Catholic in mind and deed, certainly was trying to make a point about just society of simple folk that Pope Leo XIII had in mind in Rerum Novarum
...private ownership is in accordance with the law of nature. Truly, that which is required for the preservation of life, and for life's well-being, is produced in great abundance from the soil, but not until man has brought it into cultivation and expended upon it his solicitude and skill. Now, when man thus turns the activity of his mind and the strength of his body toward procuring the fruits of nature, by such act he makes his own that portion of nature's field which he cultivates - that portion on which he leaves, as it were, the impress of his personality; and it cannot but be just that he should possess that portion as his very own, and have a right to hold it without any one being justified in violating that right.
If you either live in an apartment, work for someone and use public transportation anyone who controls their own own means of production may seem fabulously wealthy, but what the hobbits are doing is merely (and fruitfully) sustaining themselves and keeping up their own means of production. I think Tolkien would have let them live in complete serenity forever had he not set out to write a novel about them.
So, it's not that the hobbits were rich capitalists and it's certainly not that the hobbits were communists. They were living in an economic system that truly hasn't been tried in human history but seems pretty nice when you think about it.
Tolkien doesn't go much into the economics of the Shire, but it's obvious that Hobbits do indulge in a good deal of trade and exchange of goods and services. The essay in HoME 12 entitled "of Dwarves and Men" has this to say about Hobbits and trade:
Bolbo's statement that the cohabitation of Big Folk and Little Folk in one settlement was peculiar and nowhere else to be found was probably true in his time; but it would seem that actually Hobbits had liked to live with or near to Big Folk of friendly kind, who with their greater strength protected them from many dangers and enemies and other hostile Men, and recieved in exchange many services.
This is definitely the beginnings of an exchange-based economy, and LotR and other writings are chock-full of Dwarves travelling through the Shire, with an obvious familiarity.
The earlier version of the Quest of Erebor, published in Unfinished Tales, notes the following comment by Gandalf about Thorin:
As far as he was concerned they were just food-growers who happened to work the fields on either side of the Dwarves' ancestral road to the Mountains.
Gandalf also later on makes the following comment to Glóin:
...you think them simple because they are generous and do not haggle; any you think them timid because you never sell them any weapons.
So the Shire is therefore in quite regular trade with wandering companies of Dwarves, and presumably other people as well, with the primary commodity they sell being food.
Most Hobbits live a self sustaining life off the land, so they don't need to be rich. I would imagine they trade goods for goods. And any money they get goes on ale. However certain Hobbits, like those that live in Bree would trade and deal with 'big folk' and dwarves. So they would gain additional, monetary wealth that I would imagine get filtered down into the more homely places, like the Shire.
Hobbits also have a habit of bouncing gifts off each other. So much of the material wealth of the shire gets passed around from home to home.
But then you get some troublesome individuals who head off to kill dragons, or end dark reigns of terror. And they normally come back with much treasure.