CO2 and air are different. When CO2 is under pressure it is a liquid, but air remains a gas, no matter how high the pressure. A tank of CO2 will normally have mostly liquid CO2 in it, with gas on top of the liquid. When you fill the tank, the CO2 is very, very cold, so it "shrinks" to occupy less volume than when it is at 100F. If you fill the tank completely with liquid CO2, as it warms up it expands. Since there is no room for the expansion other than stretching the tank, the tank either pops its relief valve, as it is supposed to, or the tank explodes from the pressure. For that reason CO2 tanks cannot ever be completely filled with liquid, so they are filled by weight. The weight of CO2 added is that of an amount of liquid CO2 that will not completely fill the tank when the liquid CO2 warms up to 100F or some similar temperature. The gaseous CO2 on top of the liquid CO2, is also warming up, and increasing in pressure proportional to the absolute temperature of the gas. That's why a newly filled tank, still frosty on the outside, will have a pressure as low as 500 psi, but when it warms up to room temperature, the pressure will be 700-800 psi, depending on the room temperature. The liquid CO2, the gaseous CO2, the volume of gaseous CO2 and the pressure in the tank are all in an equilibrium at all times, with gas changing to liquid and vice versa as temperature changes, and as CO2 is used.
The relief valve on a CO2 tank is there as a second line of defense against the tank exploding. You can't legally fill a CO2 tank so full that the relief valve pops open as the tank warms up - the guy filling the tank is supposed to be licensed to do so, demonstrating that he understands all of this stuff.