Maybe it has to do with the specific and unique circumstances in which the characters we follow in The Hobbit and The Lord of the Rings find themselves, but it seems to me that everyone always assumes that food is free of charge and that people generously offer them both food, drinks and lodging with no payment whatsoever expected or implied.
It seems like it's "all or nothing"; either they won't even acknowledge your existence/peril at all, or they let you in and give you more than you can handle to eat and drink, and let you stay as long as you feel like it. Oftentimes offering stories and valuable information as well.
Merry and Pippin, for example, "look around" in the camp areas for where "people are eating" when they get hungry. The thought never seems to enter their minds that they would have to pay some sort of money or beg to be allowed to eat. They seem to just organize mass-meals where anyone nearby can just silently slide in and help themselves to all kinds of food and eat with people who barely will notice them.
There never seems to be any scarcity of food, except when they are completely alone in the wilderness. And even then they stumble upon some soldiers who bring them to their hidden cave and fill up their Hobbit-tummies with yummy edibles and allow them to rest in peace, even appointing servants to bring them fresh water and whatnot.
I used to be frustrated by how little money/valuables they bring when they initially set out on their journey, but it seems like they never actually need to buy food or anything. Stuff is just given to them, and even though they seem grateful and polite, it's still somehow "expected". Even at the Prancing Pony, which is literally a commercial establishment, I can't recall that they ever mention money.
Is this just how the fictional world of Middle-earth works? Or do they just get lucky? Was it actually like this back in the day in real life?