The
animation below shows schematically the operation of a regulator
second stage.

The second stage is supplied with air at
intermediate pressure from the regulator first
stage.
The air
enters the reg from the yellow block on the right of the diagram.
As the
diver inhales, the pressure in the second stage drops causing the
diaphragm (red) to be deflected.
As the
diaphragm is deflected it opens the inlet valve (blue) allowing air
to reach the diver
The air is
supplied at the ambient water pressure allowing the diver to breathe
normally.
When the
diver stops breathing in the diaphragm returns to its resting
position and the inlet valve is closed.
As the
diver breaths out the pressure in the second stage rises slightly,
this opens the exaust valve (left hand side) and vents the exhaled
air into the water
Courtesy of Apeks®.; Shown below
is a schematic diagram of the workings of an advanced second
stage.

This
design shows some of the more advanced features such as breathing
resistance control and valve balancing.
The basics
of this design are similar to that shown above.
Air enters
the unit via the yellow seat on the left, and is contained by the
rubber seating (blue).
The effect
of breathing in, is to move the rubber seating and allow air into the
body of the regulator.
The
central drilling from the rubber seating to the balance chamber
allows for balancing of the valve in a similar manner to that
achieved in the first stage.
The
cracking control works together with the spring to provide adjustable
breathing resistance. This allows the diver to tune the reg as
required by working conditions.