The type of boiler in which hot gases pass through tubes surrounded by water is a fire-tube boiler. Steam locomotives almost universally used this arrangement in their horizontal locomotive boilers.
Fuel burns in a firebox, producing hot combustion gases. Those gases travel through many narrow fire tubes or flues running through a water-filled boiler barrel. Heat passes through the tube walls into the surrounding water, generating steam that powers the locomotive’s cylinders.
The many small tubes provide far more heating surface than an older boiler with only one large flue. Marc Seguin’s 1828 development of the multi-tubular boiler helped make practical, powerful steam locomotion possible. Stephenson’s Rocket famously used a large number of fire tubes, an important step in locomotive development.
A water-tube boiler reverses the arrangement: water flows inside tubes while hot gases surround them. Water-tube designs were tested in locomotives and used in some exceptional cases, but the fire-tube boiler remained standard because its construction suited railway service. Locomotive boilers could also include superheater elements to dry and heat the steam further.