Put 23 people in a room. Would you bet that two of them share a birthday? Most people say no, because 23 is a tiny slice of 365 days. The bet is actually slightly better than a coin flip in your favour.
When you ask "does someone share my birthday?", 23 people really is too few. But the question here is whether any two people match, and that is a different count. Each person can be compared with every other person, so the number of pairs grows far faster than the number of people.
With 23 people there are 23 × 22 ÷ 2 = 253 pairs. Each pair has a 1-in-365 chance of matching. Not all of those 253 chances are independent, but together they add up to a real chance of a collision.
Each square below is one day of the year (365 squares, no leap day). Everyone in the room gets a random birthday. Squares glow pink when two or more people landed on the same day.
Roll a room of 23 several times. About half the rooms show a pink square. Then press "Run 1,000 rooms" and the tally settles close to the predicted 51%.
It is easier to calculate the chance that nobody matches, then subtract from 1. Add people one at a time. The second person must avoid one taken day: 364/365. The third must avoid two: 363/365. The fourth: 362/365. Multiply them all together and you get the chance that every birthday is different.
That product shrinks quickly. After 23 people it falls to 49.3%, so the chance of at least one match is 50.7%. The squares you just filled are the same story seen from the other side: every new person lands on a calendar that is a little fuller than before.
Once you cross the 23 mark the chance does not creep up, it rushes. With 30 people it is about 71%. With 50 it is 97%. With 57 it passes 99%, and with 70 it is 99.9%. With 100 people the chance of no shared birthday is about 1 in 3 million.
Compare that with the question "does someone share my birthday?" There each extra person adds just one pair, the one with you. You need about 253 other people to reach 50%. The gap between 23 and 253 is the gap between all the pairs in a room and the pairs that involve you.
The calculation assumes 365 equally likely birthdays and ignores 29 February. Real births are not perfectly even, with some times of year busier than others. Uneven birthdays make a match more likely, not less, so the 23 figure holds up in practice.
The same arithmetic shows up whenever collisions matter. A computer that gives out random IDs, or a system that stores items by a short code, will hit a duplicate much sooner than the size of the code suggests. Roughly, collisions begin when the number of items reaches the square root of the number of possible values. For 365 days that is about 19, and the true 50% mark of 23 sits right beside it.
So the next time a room full of people turns out to contain a shared birthday, it is not a coincidence worth gasping at. It is the pairs doing their quiet work.