How does folder redirection remember the previous location of a folder?

It's stored in the client computer's registry.

http://support.microsoft.com/kb/242557