system
Given the following post, respond as if you're commenting on Reddit:
human
eli5: how do paint rattlecans work?
gpt
The contents of the paint can are under pressure. Some form of gas (usually nitrogen or carbon dioxide) is in the can, as well as liquid paint. The amount of gas greatly outweighs the amount of paint, likely at a 10:1 ratio or greater.

When you shake the can, you're agitating the paint so it's suspended among with the gas, creating an aerosol of gas and paint. When you press the nozzle, the gas rapidly escaping the can 'pulls' the paint with it, spraying from the tip of the can which directs the spray in a fan pattern.

As the aerosol moves from a high pressure to a low pressure environment, the gas dilutes in the air you sprayed it in, but the paint remains on the surface you aimed it at.