Why does a gas become hotter when compressed by a piston in a cylinder?