The cam lobe performs 3 jobs. It opens a valve at the proper time and gives it proper lift. It lets it stay open for a sufficient time. Then it lets it close at the proper time. Accurate valve timing is crucial.

Valve timing can vary from engine to engine, as set out in manufacturers’ specifications, in the valve timing diagram.

The shape of the cam is called the cam profile or contour. With the valve lifter resting on the base circle, shown as A, the valve is fully closed and there is clearance between the rocker arm and the valve stem. The cam rotates.

The nose of the cam, B, reaches the valve lifter - and the valve is fully open.

The closing flank , C, closes the valve gradually so that it doesn’t pound against its seat.
On engines without valve lash adjusters, a quietening ramp is built into the shape of the cam. This makes for quieter operation during the opening of the valve. The shape of the nose determines how long it stays open.
The camshaft must always be synchronised to run in time with the crankshaft. This can be done by gears, chains, or toothed, timing belts.
Gear drives are most common in engines with the camshaft in the cylinder block, and in heavy-duty diesels.