John Bender (Judd Nelson) is a classic bad boy with a heart o' gold. He's not a bully, exactly—more like a juvenile delinquent. He gets some of the movie's most famous lines, and his constant obnoxious pestering and joking kicks the whole plot into gear. He's the straw that stirs the drink—the spur, the provocateur. Bender's personality is defined by its total compulsiveness: He alternates between wisecracking and indulging his genuine anger, delving into his messed-up family life.
Bender will always sacrifice his own wellbeing for a good joke. He continually harasses the supervising teacher, Richard Vernon, with jokes like "Does Barry Manilow know that you raid his wardrobe?" (which has a homophobic edge to it, since Manilow's gay) and with outright insults like "Eat my shorts" and even "F*** you!" after Vernon assigns him two months' worth of extra detentions for talking back to him repeatedly. Vernon sees him as a total punk, and at one point personally threatens to beat him up once Bender's graduated—real professional, Vern.
Sometimes his jokes are pretty funny—like when he pretends that he's going to urinate in the library:
ANDREW: Hey you're not urinating in here, man!
BENDER: Don't talk! Don't talk! It makes it crawl back up!
But other times his jokes get kind of excessive and offensive and dark. Like when early in the movie, he fake-threatens to sexually assault Claire, telling Brian:
BENDER: Hey, homeboy... Why don't you go close that door. We'll get the prom queen—impregnated.
His humor is usually a form of aggression. Bender's jokes are never purely light-hearted: They have an edge, and are aimed to irritate. All his insults toward Claire are pretty clearly masking his sexual attraction to her—which barely remains hidden, if that. ("Hey, Claire… You want to see a picture of a guy with elephantiasus of the nuts? It's pretty tasty!") Also, it was a disruptive prank that got him sentenced to detention in the first place—he pulled the fire alarm.
Like everyone else in the movie early on, he buys into all the stereotypes about himself and about all the other kids in detention. So, a lot of his humor involves attacking them for embodying stereotypes (even though he personally embodies a stereotype). He calls Brian a "parent's wet-dream" and says he could be a wrestler like Andrew if he just had a "lobotomy and some tights." Also, his destructive tendencies manifest when he starts tearing the pages out of a library book recreationally.
But without Bender's constant pestering, the story wouldn't go anywhere. It's his constant instigation that actually prompts everyone else to realize that they're not really their respective stereotypes—they transcend them.
The movie explains that Bender's delinquent tendencies stem directly from his messed-up home life. After he does an imitation of what he thinks Brian's family must be like (some 1950s artificially happy TV family), he has an exchange with Andrew:
ANDREW: All right, what about your family?
BENDER: My family? Oh, that's easy. "Stupid, worthless, no good, goddamned, free loading son-of-a-b****! Retarded, big mouth, know-it-all asshole jerk!" "You forgot ugly, lazy, and disrespectful!" "Shut up, b****! Go fix me a turkey pot pie!" "What about you, Dad?" "F*** you!" "No, Dad, what about you?" "F*** you!" "No, Dad, what about you?!" "F*** you!"
Yikes, that's bleak.
He also shows Andrew a scar on his arm from where his father burned him with a cigar for spilling paint all over the floor—which is a pretty horrific form of abuse. So we get the sense that Bender's wildness and constant joking around are kind of escape mechanisms. They're ways of dealing with or minimizing the suffering he undergoes at home.
Oh, and part of his delinquency involves doing drugs too. At one point, he leads everyone else into the hall to retrieve a bag of pot from his locker. And then they all smoke it, with the exception of Allison Reynolds.
As the movie goes on, Bender seems to realize more about himself. He understands that, in a different way, Andrew's dad abuses Andrew too by forcing him to compete so intensely and against his will. (They all bond over hating on their parents.) At the beginning of detention, Bender thought that he and Andrew were worlds apart, but he ultimately realizes that they both have Daddy issues.
Finally, instead of sexually harassing Claire, Bender understands her better, and she understands him. So—they make out. (It was inevitable from the beginning.) And Claire gives him one of her earrings as a keepsake token.
When Bender leaves detention and pumps his fist in the air at the end of the movie, he's triumphant. Why? Well, he managed to win the heart of the girl he'd been harassing for most of the movie, for one thing. So, that's kind of an accomplishment. But also, he's likely happy because he attained some greater understanding of himself and others. He's discovered the joys of learning, though not in an academic way: He's become a student of people.