The phrase "bug in one's ear" refers to a persistent and nagging thought or idea that keeps bothering someone, similar to the sensation of having an insect crawling inside your ear.