Quick definition of the problem:
Given a number of people (N), what is the probability that 2 of them will have the same birthday?
Well, with N=367 of them, you run out of different days, so that's the 100% point.
But the 50% point happens at only N=23! That's way less than 367/2!
How can that be?
The answer is fairly simple. Each person has to be compared to every other person to see if they have the same birthday. So it's not the number of people you need to pay attention to, it's the number of possible ways to make a single pair of people. That number grows very fast.
The explanation is a bit more complicated.
With 2 people, you have only 1 'pair' of people (1,2)
With 3 people, you have 3 'pairs' of people (1,2)(1,3)(2,3)
With 4 people, you have 6 'pairs' of people (1,2)(1,3)(1,4)(2,3)(2,4)(3,4)
With 23 people, you have a whopping 253 pairs of people!
The general formula for the number of pairs is to add up every counting number (1,2,3...) less than the number of people. That happens to be equal to N * (N-1) / 2, or (N^2-N)/2.
(Rule of thumb: Anything with an N^2 in it will grow faster than you expect.)
So, that's the possible number of pairs of people that *could* match birthdays. Given that number (We'll call it P, for Pairs), what's the probability that at least one pair shares a birthday? Mathematically, it turns out to be a bit easier to answer the opposite question: What's the probability that NONE of them share a birthday? That ends up being a simple multiplying of the probability that any two people don't share a birthday (1 - 1/365.2425 (Stupid leap years)) by itself a number of times equal to the number of pairs
probability of no matches = (364/365) ^ P
You either have no matches, or at least one match. Or, to put it mathematically:
probability of at least one match = 1 - probability of no matches
=1 - (364/365) ^ P
For 253 matches (that we get with only 23 people), that becomes:
1 - (364/365) ^ 253
which works out to be about 50%