It's like modulo arithmetic, I think: go far enough and you loop around to the same answer, or at least an answer. In this case, the answer is a code that works.
I'd post a link to the Wikipedia article that I read sometime ago explaining this, but I'm too lazy. More importantly, the link to rolling codes is already in the Slashdot summary so I'm sure you can get to the page explaining universal garage door openers and rolling codes from there easily (and the ensuing lawsuits from garage door manufacturers against the universal remote manufacturers).
This might be relevant http://en.wikipedia.org/wiki/The_Chamberlain_Group,_Inc._v._Skylink_Technologies,_Inc.