This question, despite being stupid, gets asked dozens of times.
First of all, and this is most likely, maybe they aren't that ugly. Maybe they are ugly by your skewed looksmax standards (male standards) and not by foid standards. And you most likely also overrate the foid. This is why I say that the question is stupid, most of the times it's not even real.
This was the most likely explanation. The rest happens once every blue moon:
If they are actually below average, they got lucky with a girl that didn't find their looks so bad. It happens because they still have some appealing physical quality that can make girls interested; in other words, they are never completely ugly, they are only like 80% ugly, but a single good feature, like height for example, gives them a chance if they get lucky.
But imo even 90% ugly guys may get a few little chances throughout their whole lives. This is where being NT plays the biggest role. ND guys miss all these chances.
It's only over when you are 100% ugly (not a single redeeming feature), or mostly ugly but also autistic. I bet that many users here fall in the second category.