Ravenclaw’s defining traits are intelligence and a desire to learn.
During Harry’s first year, the Sorting Hat describes the type of people who would find into each house. He described Ravenclaw as being the house for students with a ready mind, which most likely means those who are eager and willing to learn. This doesn’t necessarily mean that they’re already smart when they start at Hogwarts, just that they’re willing to learn.
“Or yet in wise old Ravenclaw,
If you’ve a ready mind,
Where those of wit and learning,
Will always find their kind;”
- Harry Potter and the Philosopher's Stone, Chapter 7 (The Sorting Hat)
There does also seem to be an element of ‘natural’ intelligence included in the defining traits of Ravenclaw. Through the Sorting Hat’s description of her, Rowena Ravenclaw preferred to take the cleverest students, likely meaning the students who naturally had a certain degree of intelligence.
“For Ravenclaw, the cleverest
Would always be the best;”
- Harry Potter and the Goblet of Fire, Chapter 12 (The Triwizard Tournament)
She also had said she thought Hogwarts should be for those whose intelligence was surest, which likely meant the young wizards who already had shown themselves to be smart.
“Said Ravenclaw, ‘We’ll teach those whose
Intelligence is surest.”
- Harry Potter and the Order of the Phoenix, Chapter 11 (The Sorting Hat’s New Song)
When the founders were alive to pick their own students, Rowena took the ones with the sharpest minds, which likely means they were quick at absorbing new knowledge.
“And only those of sharpest mind
Were taught by Ravenclaw”
- Harry Potter and the Order of the Phoenix, Chapter 11 (The Sorting Hat’s New Song)
So, the defining traits of Ravenclaw seem to be intelligence and a willingness to learn.
But the Sorting Hat considers students’ values and choices too.
Despite intelligence being one of the traits prized by Ravenclaw, not all smart people end up in Ravenclaw, because the Sorting Hat takes into consideration which house the student prefers. It’s also likely that some students who aren’t provably smarter than usual are put into Ravenclaw because of their preference or values rather than their actual abilities. The Sorting Hat was possibly going to put Hermione in Ravenclaw, but decided on Gryffindor instead.
“How come you’re not in Ravenclaw?’ he demanded, staring at Hermione with something close to wonder. ‘With brains like yours?’
‘Well, the Sorting Hat did seriously consider putting me in Ravenclaw during my Sorting,’ said Hermione brightly, ‘but it decided on Gryffindor in the end.”
- Harry Potter and the Order of the Phoenix, Chapter 11 (The Sorting Hat’s New Song)
In her case, this could be because she’d wanted to be a Gryffindor, because (as she said herself) she valued friendship and bravery over books and cleverness, or a combination of both.
“I’m not as good as you,’ said Harry, very embarrassed, as she let go of him.
‘Me!’ said Hermione. ‘Books! And cleverness! There are more important things – friendship and bravery and – oh Harry – be careful!”
- Harry Potter and the Philosopher's Stone, Chapter 16 (Through the Trapdoor)
Hermione considered Gryffindor the best choice, with Ravenclaw her ‘second best’.
“I’ve been asking around and I hope I’m in Gryffindor, it sounds by far the best, I hear Dumbledore himself was one, but I suppose Ravenclaw wouldn’t be too bad …”
- Harry Potter and the Philosopher's Stone, Chapter 6 (The Journey from Platform Nine and Three-Quarters)
That also means it’s likely other intelligent students might be put in a house other than Ravenclaw if they prefer it or value another trait more than intelligence. Similarly, students who aren’t obviously unusually intelligent might be in Ravenclaw because they value intelligence and learning, even if they themselves don’t necessarily have an objectively above average level of intelligence. I explain something similar for why students who don’t seem smart enough to have the cunning or ambition are in Slytherin, in my answer to this question: Why do less-bright students end up in Slytherin?