system
Given the following post, respond as if you're commenting on Reddit:
human
[LotR]How much of the history of Middle Earth do Hobbits know?

Or, for that matter, how much do the men of Gondor or Rohan know? I mostly ask because the Hobbits are pretty relaxed around Gandalf, who, it is said is a maiar. Having a being of that sort of power around should engender awe and respect. But the Hobbits see him more as a conjuror, a traveling wizard.

What's more, Gandalf has to explain to them that "There are worse things in the deep places besides orcs" before they encounter the balrog, suggesting their knowledge is quite limited.

Men are similar. Theoden refers to Gandalf as "Gandalf Stormcrow" and seems similarly unaware of Gandalf's true nature.
gpt
*Very* few people know about Gandalf's true nature until after the War.  Cirdan the Shipwright (in charge of the Grey Havens) is one of the few besides the other wizards themselves.  Some of the absolute highest of the High Elves probably knew, such as Elrond and Galadriel, but no one else.  Hell even Saruman saying "Rods of the Five Wizards" to Gandalf is letting private information slip.  No one really knew or had any reason to know of the two Blue Wizards who went East.  Even Tolkien ultra-fans no almost nothing because Tolkien did little more than mention them.

As to the rest of the question it's a little case-by-case.  The Hobbits knew a surprising amount, although it's mostly in old fairy tale form.  Stuff that adult hobbits wouldn't take seriously, though the echo of ancient knowledge is still there.  Bilbo had heard of 'magic rings', though he didn't really know anything concrete about them, Frodo knew of Sauron in a very vague, general sense, and even Sam had learned some poetry about the old Elf King Gil-Galad from Bilbo.  

Rohan is a bit similar.  Theoden had heard ancient tales of *holbytla*, which turns out to be an ancient word for *hobbits*.  They just didn't know those tales had any truth to them since no one from Rohan had any desire to seek them out.  So they have more knowledge than they know.  They're unfortunately just not a very scholarly society.

By the end of the Third Age, Gondor is in the end of a long, slow decline.  The average Gondorian wouldn't know much, but Gandalf finds Isildur's personal writings on the Ring after digging through some ancient archives.  Denethor, Faramir, and Boromir all speak fluent Elvish, and likely know a great deal of ancient lore, but as each generation goes by it becomes less and less.  At least until Aragorn brought them a sort of renaissance.  

The Elves naturally know plenty, as they were there for it all.  Bilbo and Aragorn know all they know from the Elves.  It's heavily hinted at the Silmarillion may just be Bilbo's notes he took from what he learned in Rivendell.

Also as a side-point, Gandalf had no idea a Balrog was in Moria before they went there.  He knew *something* was there, he just didn't know what.  A Balrog hadn't even been seen for at least ~6000 years and for all he knew there were none left.  There were only ever 4-7ish and they were supposedly wiped out at the end of the First Age.