The smokebox is where steam from the cylinders and the smoke from the firebox in a steam locomotive come together to escape through the smokestack. When coal, wood or oil is burnt in the firebox, the smoke and hot gases escape through long tubes. These tubes are surrounded by the water in the boiler. This heats up the water in the boiler and creates the steam that drives the cylinders (see Steam Dome.) Then the smoke and hot gases come out of the end of these tubes, and enters the smokebox. The smoke and hot gases are then drawn up the smokestack by the steam escaping through the blastpipes from the cylinders. The smokebox is usually directly below the smokestack and usually painted matt-black, to hide the soot. The smokebox is a very important part of a steam locomotive.
The smokebox also contains the superheater header, if fitted, which 'recycles' the steam through the superheater tubes, heating the steam a second time.