The hammer is pulled back by a leverage mechanism when you pull the trigger. When it reaches a certain point, the mechanism releases the hammer. The hammer is attached to a spring mechanism which springs back when the hammer is released, pulling the hammer back to its original position. I hope that makes it clearer. If you have a spring and pull it out, it goes back to the way it was as soon as you let it go. Does that help?
Nan