The size in and of itself is not important. The size of the brain relative to the rest of the body does seem to be correlated with intelligence. (E.g., blue whales have much bigger brains than people, but that doesn’t make them any smarter.)
This isn’t a very strong correlation, though. Most of the brain isn’t used for thinking in the way we usually use the word. It’s used for perceiving, moving, and other stuff. So what really counts is the size of an area called the prefrontal cortex (again, relative to the rest of the body).
On top of that, calculating brain volume is complicated by the fact that brains can be wrinkly and have deep ridges and grooves called sulci and gyri. These provide more surface area, making bigger brains in a compact space. Animals we generally regard as intelligent, like dolphins and apes, have wrinkly brains. (There are people both without wrinkles in their brains—a condition called lissencephaly—who suffer from extreme cognitive impairment and usually don’t survive longer than a few months.) So a prehistoric hobbit with a tiny, wrinkly brain would be much smarter than a prehistoric hobbit with a tiny, smooth brain.