Fakes is a productised version of the Moles framework which came out of Microsoft Research. You can refer to the publicly available references for the Moles framework to get a handle on how Shims work.
In short the redirection is implemented using the .net profiler callbacks.
Refer