Have you stepped through this with a debugger? That's going to help you understand much more effectively than somebody else explaining it will.

What do you mean "how does it work"?