Why does Stella and Stanley's relationship prevail at the end in A Streetcar Named Desire?
Whatever else may be said of the Kowalskis' relationship, there's no doubt that it's based on love. Stanley may be a hulking great brute who regularly abuses his wife, but there seems little doubt that he still loves her, even if he has a very funny way of showing it.
As for Stella, she loves Stanley, despite his ill-treatment of her. In him, she sees a lover, a fighter, and a protector, a macho guy who fits in with her rather narrow ideal of what a man should be.
Because Stella and Stanley's relationship is based on mutual love, Blanche has no chance whatsoever in getting her sister away from a man she regards with utter contempt. For the educated Blanche, to be uneducated is synonymous with being stupid, so in her eyes, the uneducated Stanley is indeed a very stupid man.
This snobbish assumption ultimately leads to Blanche's undoing, as it makes her underestimate Stanley. Though definitely not an educated man, Stanley is nonetheless quite smart, as can be seen in his quoting chapter and verse of the Napoleonic Code at Blanche and the way in which he outmaneuvers her when it comes to keeping hold of Stella.
When all's said and done, however, it's not Stanley's street smarts or Blanche's miscalculations regarding her sister that enables the Kowalskis' relationship to prevail in the end, but the deep love they have for each other.