Mr. B is a wealthy gentleman and the son of Pamela's late mistress. At the beginning of the novel, he takes over the household and becomes Pamela's boss. Pretty soon he becomes her worst nightmare—and then he becomes her husband.
That's a lot of character development for one country squire, so let's get to it.
Mr. B most of the novel being a good, old-fashioned, virgin-raping villain. Thanks to his wealth, class, and upbringing, he's used to getting what he wants—and what he wants is Pamela. He repeatedly tries to trick her into hooking up with him, or even raping her, but she manages to repel him over and over, usually by fainting or having a fit at the critical moment. Eventually, he tries the relatively more civil approach of formally asking her to be his mistress, which she rejects as well.
All these attempts to have his way with Pamela show us something nasty about his character: he sees servants, and probably anyone less wealthy/ high-ranking/ male than he is, like a piece of property he can buy, sell, or seduce at any given moment.
The second most unpleasant thing about Mr. B is that he has the kind of temper tantrums that would earn a toddler two minutes on the Naughty Step. He mansplains it to Pamela this way:
We People of Fortune, or such as are born to large Expectations, of both sexes, are generally educated wrong. [….] We are usually so headstrong, so violent in our Wills, that we very little bear Controul. (93.169)
In other words, Mr. B has a bad case of affluenza.
Mr. B turns a corner after his final attempt to rape Pamela. His attack throws her into a violent fit, and he resolves to reform. In a conversation after the incident, he tells Pamela as much:
[T]hat I did intend what you call the worst, is most certain: And tho' I would not too much alarm you now, I could curse my Weakness and my Folly, which makes me own, that I love you beyond all your Sex, and cannot live without you. But, if I am Master of myself, and my own Resolution, I will not attempt to force you to anything again. (64.41)
Check out the way he phrases it: he resolves to be "Master" of himself. He might have been the "master" all through the book, but the contrast between him and Pamela shows us that he's not even master of himself. Without control over his own behavior, he can't possibly expect to be a good aristocrat. In other words, Mr. B has to learn how to value Pamela as a person in her own right, but he also has to learn how to value himself.
After Mr. B has his come-to-Jesus moment (literally), he seems torn between wanting to do the right thing by Pamela and believing that his wealth and social status mean he can't marry her. He ultimately comes to the conclusion that he will "defy the World, and the World's censures" (71.22) and put a ring on it.
Only problem is, not all the aristocrats around him have had the advantage of learning from Pamela how to behave properly. Mr. B and his sister get into a very nasty fight when she learns he's actually married to a servant—but thanks to Pamela's intercession, Lady Davers and Mr. B make up. Lady Davers comments on the changes that have taken place in Mr. B's temperament, noting, "I never knew him forgive so soon" (93.127). She also highlights other qualities that he has had all along:
he has his Virtues, as well as his Faults; for he is generous, nay, he is noble in his Spirit; hates little dirty Actions; he delights in doing Good: But does not pass over a willful Fault easily. He is wise, prudent, sober and magnanimous; and will not tell a Lye, nor disguise his Faults. (94.13)
Huh. That's news to us—although Pamela also chimes in later with some of the good qualities he has had all long, noting that "he was always remarkable for Courage" (93.132).
When he marries Pamela, Mr. B expresses remorse for his past behavior:
I have taken Liberties in my former Life, that deserved not so much Excellence. I have offended extremely, by Trials glorious to my Pamela, but disgraceful to me, against a Virtue that I now consider as almost sacred; and I shall not think I deserve her, till I can bring my Manners, my Sentiments, and my Actions, to a Conformity with her own. (92.166)
The message: Pamela's resolve and piety were not only powerful enough to keep her safe from Mr. B's attacks, but also succeeded in reforming her attacker.
It's a nice story, right? There's just one problem: it hardly ever works like that in real life, and it seems that people might have taken the book a little too literally.
A few years later, Richardson published Clarissa as a kind of corrective to the fairy-tale story of Pamela. In the preface, he said he wanted to show girls the error of the "dangerous but too commonly received notion, that a reformed rake makes the best husband" (preface.12). (Brain Snack: a "rake" was basically the eighteenth-century equivalent of a player.) In Clarissa, the virtuous girl doesn't get her happy ending: the degenerate aristocrat rapes her, and she dies from shame.
So, the next time a bad boy invites you to hop on the back of his motorcycle, remember that not every rake can be reformed.