The contents of a can of air freshener are gaseous when sprayed, but remain a liquid while inside the can due to internal high pressure in can.
Volume and aggregate state of substance depends on pressure. If we increace the pressure, volume of substance is decreased and vice versa. Because molecules is closer to each other molecule turns into liquid or solid.