This was actually the topic of one of my undergrad research papers when I was getting my teaching certification way back when. It was coined “Gifted Underachiever” at that time. I chose the topic because of my own brother, truly brilliant, but never turned in homework and didn’t do well in school UNTIL he found out what he needed to do to get into his aeronautical engineering and pilot program. Even then he only did the bare minimum to meet the threshold. Once he was in a program he was very interested in and passionate about, he excelled.
Growing up he was hyperfocused on flight and planes, but couldn’t be bothered with most everyday tasks; he couldn’t read a book unless it was a topic that interested him. He scored a near perfect score on the SAT, but felt high school was a waste of his energy. If you haven’t picked up on the symptoms, he’s ADHD. He truly felt HS was a waste of time as he thought he knew more than his teachers; in all fairness he did. This was long before “neurodivergence;” ADHD wasn’t a prevalent diagnosis and autism wasn’t a household word. Many of the students I spoke with at that time had similar feelings about high school; they were not motivated by grades, but they put their efforts into other aspects of their lives like ECs and hobbies. Here is an article from UCON; this was written after my college days, but it does give insight into the term.
Edited to add: special needs aren’t the only reasons for this phenomenon. It’s just one of many possible scenarios. I chose the article for its insight into term “gifted underachiever.”