Easy, there is just a database at tinyurl.com that maps a long URL (that someone feeds it) to a short code. When you link to tinyurl.com with the short code it redirects you to the URL it was given.

Even a 4 letter alpha code would allow half a million urls to be mapped, don't know how long the codes they use are.
_________________________
Remind me to change my signature to something more interesting someday