Gentleman Brown is not, we repeat, not a gentleman. Point of fact: dude's a pirate. That doesn't exactly scream upstanding citizen. He stirs up ten kinds of trouble for our Jimmy. Yep, he ruins just about everything.
Brown comes late to the Lord Jim party. He doesn't arrive on the scene until Chapter 37. But even though he missed h'ors d'oeuvres, dinner, and barely made dessert, the guy was late for a good reason. He's here to bring about the novel's action-packed conclusion.
By the time Brown shows up, we have spent page after page sussing out who Jim is. Is he a coward? A hero? A bit of both? Gentleman Brown arrives just in time to give us one last glimpse into Jim's character. How does Brown do that? By acting as a foil for Jim. Let's compare the two.
Like Jim, Brown is a total romantic. He is all about high seas adventure. We might think of him as a Jim sans moral compass. He gets his adventure kicks by pillaging and plundering, although in the end that does not actually get him very far:
The world he had bullied for twenty years with fierce, aggressive disdain, had yielded him nothing in the way of material advantage [...] He was tired of his life, and not afraid of death. But this man, who would stake his existence on a whim with a bitter and jeering recklessness, stood in mortal fear of imprisonment. (38.3)
He may be the most fearsome pirate around, but he has fears of his own (namely, prison), and his life has not been as rich as you might think. Brown lands on Patusan with the sense that the world owes him something. His reputation as a Seriously Bad Dude precedes him. His notoriety proves true, of course; no sooner does he arrive on Patusan than he immediately makes plans to do all kinds of piratey things.
But he is quickly foiled by none other than Lord Jim. Realizing he can't defeat the powerful, popular Jim, Gentleman Brown opts for a parley. That's when things get interesting.
In chatting with Jim, Brown spots an easy target for manipulation:
When he asked Jim, with a sort of brusque despairing frankness, whether he himself – straight now – didn't understand that when "it came to saving one's life in the dark, one didn't care who else went – three, thirty, three hundred people" – it was as if a demon had been whispering advice in his ear. "I made him wince," boasted Brown to me. (42.1)
Brown is one smart dude. He knows how to hit Jim where it hurts – his past. Even though he too has fears and soft spots, Brown out-manipulates Jim, which puts our hero in a tight spot. With the help of the dastardly Cornelius, Brown brings about Jim's downfall, which brings a swift end to the novel as well.
In the end, each man kind of ends up with the death the other was destined for. Jim dies in a dramatic execution scene after a big battle – something Brown probably expected for himself. Brown dies disgraced, sick, and alone in a hospital while yammering on to Marlow, a fate Marlow once predicted for Jim.