The shock has an inner and an outer tube. The rod and piston are in the inner tube with a foot valve controlling fluid flow between the inner and outer tubes. There must be a space between the tubes filled with pressurized nitrogen gas to allow room for fluid displaced by the volume of the piston rod.
When the shock is fully compressed, you can see the large amount of fluid that has flowed between the inner and outer tubes though the foot valve. This is the fluid that allows for adjustment to the compression damping.
The rebound adjuster is found at the top of the shock and it turns a rod that adjusts preload on a spring loaded needle valve that controls fluid flow past the piston as the shock is extending.
The compression adjuster is found on the bottom of the shock and it also controls preload on a spring that puts pressure on a needle valve that controls fluid flow between the inner and outer tubes as the shock is being compressed.