A video of how a diesel pile driver works.
A modern diesel pile hammer is a very large two-stroke diesel engine. The weight is the piston, and the apparatus which connects to the top of the pile is the cylinder. Piledriving is started by having the weight raised by auxiliary means usually a cable from the crane holding the pile driver which draws air into the cylinder. The weight is dropped, using a quick-release. The weight of the piston compresses the air, heating it to the ignition point of diesel fuel. Diesel fuel is added/injected into the cylinder. The mixture ignites, transferring the energy of the falling weight to the pile head, and driving the weight back up. The rising weight draws in fresh air, and the cycle starts over until the fuel runs out or is stopped by the pile crew.