It doesn't, and since the D5100 has a pentamirror rather than a pentaprism, when the lens stops down the viewfinder image gets pretty dark.
Plus, to make auto focus work the main mirror in autp focusing cameras is only 50% reflective. The other 50% of the light goes through the mau\in mirror to a secodary mirrior behind it that directs the other 1/2 of the light down to the auto focus module in the bottom of the camera body.
Auto focus is not the be all to end all may people think it is. There are some rather substantial negative trade offs, like DoF preview in cameras that have it that is often less than useful.