A cam is a projecting part of a rotating wheel or shaft that strikes a lever at one or more points on its circular path. The cam can be a simple tooth, as is used to deliver pulses of power to a steam hammer, for example, or an eccentric disc or other shape that produces a smooth reciprocating (back and forth) motion in the follower which is a lever making contact with the cam.
The reason the cam acts as a lever is because the hole is not directly in the centre, therefore moving the cam rather than just spinning.
The cam can be seen as a device that translates movement from circular to reciprocating (or sometimes oscillating). A common example is the camshaft of an automobile, which takes the rotary motion of the engine and translates it into the reciprocating motion necessary to operate the intake and exhaust valves of the cylinders.
The opposite operation, translation of reciprocating motion to circular motion, is done by a crank. An example is the crankshaft of a car, which takes the reciprocating motion of the pistons and translates it into the rotary motion necessary to operate the wheels.
Cams can also be viewed as information-storing and -transmitting devices. Examples are the cam-drums that direct the notes of a music box or the movements of a screw machine's various tools and chucks. The information stored and transmitted by the cam is the answer to the question, "What actions should happen, and when?" (Even an automotive camshaft essentially answers that question, although the music box cam is a still-better example in illustrating this concept.)
Certain cams can be characterized by their displacement diagrams, which reflect the changing position a roller follower would make as the cam rotates about an axis. These diagrams relate angular position to the radial displacement experienced at that position. Several key terms are relevant in such a construction of plate cams: base circle, prime circle (with radius equal to the sum of the follower radius and the base circle radius), pitch curve which is the radial curve traced out by applying the radial displacements away from the prime circle across all angles, and the lobe separation angle (LSA - the angle between two adjacent intake and exhaust cam lobes). Displacement diagrams are traditionally presented as graphs with non-negative values.