The high-pressure steam for a steam engine comes from a boiler. The boiler's job is to apply heat to water to create steam. There are two approaches: fire tube and water tube.
A fire-tube boiler was more common in the 1800s. It consists of a tank of water perforated with pipes. The hot gases from a coal or wood fire run through the pipes to heat the water in the tank, as shown here:
In a fire-tube boiler, the entire tank is under pressure, so if the tank bursts it creates a major explosion.
More common today are water-tube boilers, in which water runs through a rack of tubes that are positioned in the hot gases from the fire. The following simplified diagram shows you a typical layout for a water-tube boiler:
In a real boiler, things would be much more complicated because the goal of the boiler is to extract every possible bit of heat from the burning fuel to improve efficiency.
For more information on steam engines and all sorts of other engines, check out the links on the next page.