The heat required for boiling the water and supplying the steam can be derived from various sources, most commonly from burning combustible materials with an appropriate supply of air in a closed space (called variously combustion chamber, firebox).
What is the usual source of heat for boiling water in the steam engine?
burning combustible materials