As feed water (dark green) enters the first three housings, it will typically get filtered through a sediment filter to prevent clogging, and carbon filters to remove organic contaminants as well as chlorine, bad taste and odor.
Once the pre-filtration has completed, the water passes through the reverse osmosis membrane. High water pressure is typically needed to force the water to pass through the tiny sub-micron pores. Since not all the water can pass through the membrane, it will create waste water which flows down the drain (purple).
As water slowly gets enough pressure to push through the membrane, it will eventually start filling the tank line (yellow). Once the tank fills, it will turn the system off once the pressure equalizes in the hydraulic shut off valve - not seen.
When water is demanded at the faucet, water is drawn from the tank and flow is reversed through the tank line (yellow) and passes through the post filter and up the faucet line (light green).
The system then repeats as needed.