John Barsad agrees to help Sydney Carton trade places with Charles Darnay. Since the two men look alike, Carton will take Darnay’s place at the guillotine so Darnay can live happily ever after with Lucie.
John Barsad (whose real name is Solomon Pross) is the “patriot” who testifies at Darnay’s trial. When asked if he has ever been a spy himself, he of course denies it. Stryver describes him this way:
Barsad, was a hired spy and traitor, an unblushing trafficker in blood, and one of the greatest scoundrels upon earth since accursed Judas—which he certainly did look rather like. (Book 2, Ch 3, p. 48)
Of course, Barsad is Miss Pross’s brother. In Paris, Carton sees Barsad coming out of the prison and follows him. He knows exactly who he is, and he knows that he can get Barsad to do pretty much whatever he wants because Carton knows his name and can denounce him as a spy.
Carton brings Barsad/Pross to Lorry and he tells him that Darnay has been arrested. Carton explains that he can “win” Barsad’s friendship with his excellent “cards” (the dirt he has on him).
Mr. Barsad, now in the employ of the republican French government, was formerly in the employ of the aristocratic English government, the enemy of France and freedom. That’s an excellent card. (Book 3, Ch 8, p. 192)
So Barsad agrees to help get Carton into the prison, Carton switches places with Darnay, and Darnay survives while Carton dies in his place.