The crankshaft sometimes casually called the crank, is the part of the engine which changes the up and down motion of the pistons into rotation. To convert the motion the crankshaft has one or more offset shafts. The pistons are connected to the crankshaft by these shafts. When the piston moves up and down, it pushes the offset shaft. This in turn rotates the crankshaft.
The pistons cause a pulsing affect in the rotation. A crankshaft usually connects to a flywheel. The flywheel smooths out the rotation. Sometimes there is a torsion or vibration damper on the other end of the crankshaft. This helps reduce vibrations of the crankshaft.
Large engines usually have several cylinders. This helps to reduce pulsations from individual firing strokes. For some engines it is necessary to provide counterweights. The counterweight is used to offset the piston and improve balance. While counterweights add a lot of weight to the crankshaft, it provides a smoother running engine. This allows higher PRMs to be reached and more power produced.