It's a metaphor that compares someone's obsession to a bee trapped in a hat, constantly buzzing around and causing annoyance.
Here are some ways the phrase is used:
* "She's got a bee in her bonnet about recycling." This means she's constantly talking about recycling and trying to convince others to do the same.
* "He's got a bee in his bonnet about getting rich quick." This means he's obsessed with making money quickly and doesn't seem to care about the consequences.
The phrase is often used humorously to describe someone who is a bit eccentric or obsessed with a particular idea. It can also be used in a more negative way to suggest that someone is being unreasonable or obsessive.