system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why are we able to develop lifelong immunity to some infectious diseases like measles but not others like syphilis, gonorrhea, or throat infections/strep throat?

Does our immune system not work with STDs? I am learning about our immune system and how our antibodies work. I don't understand what happens in which we are able to get re-infected with certain infectious disease if we should have immunity. Im guessing our immune system just doesn't work properly against these infections?
gpt
There are big swaths of this we don't understand and are still studying.

But one thing that affects it is how our body decides to respond. There are organs your body considers very important and if it detects infection there it will mount a very strong response. But it turns out your upper respiratory system isn't considered a big deal by your body, so it responds to infections there with a weaker immune response. (This may be because your nose/throat is a first line of defense against stuff getting into the lungs, so it's constantly being exposed to bad junk and if your body reacted strongly to every incoming threat you'd be exhausted. Or be a person suffering from allergies.) 

That explains why flus and throat infections tend to take hold consistently. Our body sends in the B-team at first and waits until it realizes things are bad to mount a larger-scale response. This is a big part of how COVID gets its foot in our doors!

Some viruses mutate quickly. That means even if we did see it before and make antibodies for it, the new mutations might "look" differently enough our immune systems don't recognize it. One of the few breaks we got from COVID is the protein we target with vaccinations is crucial to how COVID infects people, so it's very unlikely COVID can mutate in a way that fully evades vaccines AND still be able to infect us. That's why despite new variants, the vaccines are still pretty effective at giving our immune system a head start.

But we still get sick, what gives?

Reproduction speed. Some viruses (and some mutations) replicate FAST. If they can reproduce faster than our immune system can make antibody cells, they'll overwhelm us. That's why Omicron seems to "evade" the vaccine. Our immune system can detect Omicron just fine, but our body sees a viral infection in our upper respiratory system and doesn't mount a very strong response. Then Omicron reproduces like crazy and by the time our body knows there's a problem we're already "behind" and the virus can move to other organs. 

So we're the worst at handling diseases that mutate a lot, reproduce quickly, and target "unimportant" parts of the body. STDs usually qualify here because despite reproduction being a big goal for biological organisms, we can still live a quality life without those organs so they're treated as low priority by many survival systems.