Everyone knows someone who has had condomless sex for years and never had a diagnosis. It is worth taking the question seriously, because the explanations are mostly unremarkable and one of them matters a great deal.
They may not be uninfected
The most important explanation. Most infections cause nothing you would notice, particularly at rectal and throat sites, and someone who has never had a three-site screen has never had the opportunity to find out. Someone who tests only urine and only when worried can carry gonorrhoea for months and describe themselves as never having had anything. Untested is not a synonym for uninfected.
Network position
The largest real factor. Infection risk depends heavily on the prevalence in the group your partners come from and on how densely connected that group is. Someone whose partners are drawn from separate loosely connected circles faces genuinely lower exposure than someone in a dense high-prevalence network, with identical behaviour.
Chance
Straightforwardly. Per-act transmission probabilities are well below one for every infection discussed here, so long runs without acquiring anything occur naturally. Someone who has had a hundred exposures at a one per cent risk has a reasonable chance of having avoided it entirely. That is luck rather than a method, and it says nothing about the next hundred.
What they are actually doing
People describe their sex lives loosely. Someone who says they never use condoms may use them with new partners, or be exclusively insertive, or have fewer partners than the impression given. Small differences in acts and roles produce large differences in cumulative risk.
Vaccination
Someone vaccinated against hepatitis A and B, HPV and mpox has genuinely removed four infections from their list permanently. That is not luck and it is available to anyone free at a sexual health clinic.
Is there a biological component?
A small one. A rare genetic variant affecting a receptor HIV uses provides substantial protection in the few people who carry two copies, and it is uncommon enough to be irrelevant to almost everyone. Variation in mucosal immunity and in the bacteria living on mucosal surfaces probably contributes to susceptibility to bacterial infections, but this is not established well enough to act on and there is no test for it.
Why does this matter?
Because people draw conclusions from other people's apparent luck. If someone you know has never had anything, that is not evidence their approach works, and copying it will not transfer their network position or their chance. It is a particularly unreliable form of evidence because the people who did acquire something are less likely to have mentioned it.
What about people who get infections constantly?
Usually the mirror image: a dense network, frequent testing so more is found, and no immunity conferred by past infection. Repeated gonorrhoea in particular reflects epidemiology rather than carelessness, and treating it as a personal failing is both inaccurate and unhelpful.
Does age matter?
Cumulative exposure increases with age, so someone who has been sexually active for thirty years has had far more opportunities than someone who has been for three. That makes a long clean run less remarkable than it appears in an older person and more so in a younger one, which is the opposite of how people usually read it.
The useful conclusion
Build a plan around what is under your control, which is vaccination, PrEP and screening frequency. Comparing yourself to someone else's run of luck tells you very little about your own.
Does having had something make you more likely to get it again?
Not through any change in susceptibility, but yes in practice, because it usually indicates a network where the infection circulates. Repeat gonorrhoea is common for exactly this reason, and it reflects where you are rather than anything about your body.
Is there anything you can do about susceptibility?
Reduce mucosal damage, treat existing infections promptly since inflammation increases susceptibility to others, and avoid douching immediately before sex. These are modest effects compared with vaccination and PrEP, but they are real and they cost nothing.