The hammer slams into the primer at the back of the cartridge, igniting the primer.The compressed spring drives the hammer forward.When you pull the trigger all the way back, the lever releases the hammer.
At the same time, the trigger rotates the cylinder so the next breech chamber is positioned in front of the gun barrel. As it moves backward, the hammer compresses a metal spring in the gun stock (the handle).