The camshaft has lobes (bumps) on its surface. As the camshaft rotates, these lobes push on valve lifters (or tappets), which in turn push on the valves, opening them at precisely timed intervals. When the lobe rotates past the lifter, spring pressure closes the valve. The timing and duration of valve opening and closing are crucial for efficient engine operation.
There are typically two camshafts in a modern multi-valve engine: one for intake valves and one for exhaust valves. In simpler engines, a single camshaft might operate both.