It happens multiple times in the novel -- Jane's desire to be true to herself (her conscience, her friends, or her concept of self), but the world is arrayed against her. It begins in her childhood, with the Reeds hypocrisy and abuse, and Jane's inability to submit to it. If Jane had, perhaps, submitted more to her aunt, and toadied to her aunt's need to feel superior to her, then Jane might not have been sent off to Lowood. But Jane, young as she was, was not able to submit to injustice. So she was sent to Lowood school, which was at once a place of possible death for her, and also the place that gave her enough education to make her own poor way in the world.
At Lowood this pattern was repeated again-- especially in the death of Helen. Jane, after her two best friends left Lowood (by death and marriage), found it intolerable to stay at the site of so much suffering, and took the very dangerous option of going out into the world to make her way as a governess.
It seems, at least for a time, that at Thornfield Jane's strength and pride will be appreciated (or at least not knocked down at every opportunity). But she learns that Mr. Rochester, though he loves her and she desperately loves him, has locked his insane wife in the attic. So, since she cannot bear to be a bigamist or the mistress of a married man, she foolishly runs away in the night.
When she is finally rescued from death by St. John Rivers and his sisters (who turn out to be her half-cousins!) she once again has a place to rest, where, perhaps, she will not be forced into violating her own rules of conduct. But St. John, learning that she has an inheritance and wishing to take a wife with him on a religious mission, asks her to marry him, again placing Jane in a situation where she has to turn down what most people would consider a rise in station. She won't marry St. John because she loves Rochester, and, it appears, St John doesn't really know how to love a woman properly. Finally, after all of this, when Rochester has become a widower and has been crippled by the almost complete loss of his sight (and, thus, is no longer so much over her in strength and station and therefore Jane does not have to submit so much to his authority) is Jane able to marry him.
Jane generally resolves these conflicts in one of two ways -- she takes the more difficult option (running away from Thornfield, going to Lowood) in order to not sacrifice her principles,or by simply removing herself from the situation (running away from Thornfield again, and leaving St. John). Jane consistently shows that her character is more important to her than her comfort (or even her safety, sometimes!), and, in the end, she is rewarded with her heart's desire. It is such an effective ending because it is how many of us wish life to be -- that we are strong enough to stick to our principles, and, in the end, we are rewarded with what we want most in the world.