Biography
Many main characters in children's shows (and in adult's shows featuring children) are explicitly shown as doing very badly in school, despite showing themselves to be of at least average intelligence in most other areas of life. This isn't inconsistency on the part of the writers, though. The kid is just Book Dumb.
Making your child character Book Dumb is seen as a great way to appeal to the masses (especially when creating a This Loser Is You) without having to show them being outsmarted by other characters on a regular basis. A Book Dumb character will usually show excellent "street smarts", is quite capable of thinking on their feet, and is often very good at problem solving most of the time, but he (and it is usually a boy) does not function well within a regimented learning system. Maybe he's just not good at that type of learning. Maybe he's clever, but can't resist an opportunity for mischief. In extreme cases, he may even be a genius or inventor at home, but devolves into a functionally illiterate bad boy as soon as he enters through the school gates. Maybe he's just Too Dumb to Fool. Or he might be a Genius Ditz. But he is rarely an Apathetic Student.
On the other hand, some writers will try the opposite rationale and use it as a criticism of the school system, either claiming that schools are staffed by incompetent idiots who don't know intelligence when they see it, or that schools are deliberately designed to stifle innovation and free will in order to turn kids into mindless future wage slaves.
Some characters are book dumb due to having been denied a formal education for various reasons. They might not be in any way stupid or lazy but a lack of opportunity has simply restricted their progression.
His own attitude to his schooling varies considerably, often within the same series. One episode may call for him to seem to care about his problem, and try very hard to get the work done, whereas another episode may show him really not caring about schoolwork at all. This doesn't matter; as long as the writer gets across that this character isn't some kind of fancy intellectual at whom the audience should sneer, then the Book Dumb has done its job.
In shows with high school characters, Book Dumb often overlaps with Troubled, but Cute, especially in Western media.
This is also common among adults, who will be portrayed as not having done very well at school, even though today they may be a famous novelist, celebrated artist, top sportsman, or nuclear safety inspector. If the character is doing a non-creative job, he will usually be just as ineffective in his job as he was at school (though always managing to avoid George Jetson Job Security), while displaying considerable intelligence in other areas of their life.
More or less the polar opposite of the stereotypical nerd, who does excellently in school but is shown as being almost completely incompetent in all other areas of life. Both can be very intelligent people, but only in certain circumstances. The different attitudes of most people to each type of character betray our society's mistrust of intellect. Both, however, can be Geeks.
Book Dumb female characters are quite common in Anime and Manga but in Western media this trope tends to skew heavily male. The popularity of the Uptown Girl trope might also be a factor.
This is one of the ways writers have evolved Brains Versus Brawn since this trope allows you to maintain the contrast between the "smart" and "dumb" character, while also giving the dumb character both more complexity than a one-note idiot character and a leg up in the competition over their smarter foil who often suffers from a lack of Street Smarts.
This trope has quite a bit of Truth in Television. As any teacher can tell you, there is something about the school system that does alienate a certain portion of otherwise intelligent children, although the pervasiveness of this trope frustrates some students that are held to Teen Genius standards by their parents, wondering why nobody that actually does well in school is ever the main character. Most troublingly, this trope is popular among anti-intellectuals, who argue that academic smarts are entirely worthless. Of course, being anti-intellectuals, their arguments lack a certain... something. Luckily some school systems are trying to do things to solve this problem, as it often makes learning easier for everybody anyway, and several systems have been in use since just after the Turn of the Millennium, although wide-spread adoption has yet to occur anywhere. Also, most book-dumb people in real-life often resort to looking up the answers to their schoolwork online — typically through the likes of Wikipedia — to put on an intelligent façade in pursuit of popularity (or at least not flunk out and get in trouble).
The inversion is Book Smart. Contrast TV Genius, who only seems intelligent in the classroom, and Ditzy Genius, who is a genius in academics but inept in everyday life. Also contrast Insufferable Genius, who is very talented and arrogantly proud of it. Compare Brilliant, but Lazy, which underlies this most of the time, and Everybody Hates Mathematics, the roughly mathematical equivalent. Technical opposite of the Badass Bookworm. If they're asked to do an essay, they might end up Padding the Paper.