You see that everywhere, right?
Now, if we can do that for people, why can't we do that for socks? Everybody has at least 5 socks that don't have a match. So you put your sock online, somebody has the match and ta da! You now have a pair of socks.
Don't know how you decide who gets the socks, but once you get past finding a match that part is trivial.