Brain size doesn't seem to matter for intelligence. My wife is much smarter than I am despite the fact that women have, on average, smaller brains.
My recent fascination with brain function was due to an insight I made about what the brain does best: pattern recognition. This skill is at the forefront of computer science progress and is responsible for speech and facial recognition, the dominance of computers over humans in games like chess and go, medical diagnosis, technological unemployment, matchmaking, learning and music composition.
My thesis is that brains evolved to optimize pattern recognition - and they did so spectacularly. I believe it was accidental in the way that all evolution is accidental. It may have begun by detecting light and dark and eyes were born. The ability to detect and ultimately discern smells, touch, sounds and taste gave us an evolutionary edge. Then we developed motor skills to impact our environment. At one point, I believe, the pattern recognition became responsible for memory and ultimately consciousness.
All this is pure speculation and I wish I had time to research the subject more completely. Perhaps a train ride to the West will afford the opportunity.