The volume of water expands as it turns to steam inside the boiler, creating a high pressure. The expansion of steam pushes the pistons that connect to the driving wheels that operate the locomotive. Coal or oil are the fuels used for heating the water (coal is shown in the diagram).