A steam engine is a heat engine that makes use of the potential energy that exists as pressure in steam, converting it to mechanical work. Steam engines were used in pumps, locomotive trains and steam ships, and were essential to the Industrial Revolution. They are still used for electrical power generation.
A steam engine needs a boiler to boil water to produce steam under pressure. Any heat source can be used, but the most common is a wood or coal fire. The steam is allowed to expand by pushing against a piston or turbine, whose motion is used to do work.
The first steam device, the aeolipile, was invented by Heron of Alexandria, a Greek, in the 1st century AD, but used only as a toy. Denis Papin, a French physicist, built a working model of a steam engine after observing steam escaping from his pressure cooker in about 1679. Early industrial steam engines were designed by Thomas Savery (1698), Thomas Newcomen (1712), and James Watt (1769), each of whom added new refinements.
Nicolas-Joseph Cugnot demonstrated the first functional self-propelled steam vehicle, his "steam wagon", in 1769. Arguably, this was the first automobile. Steam engine powered automobiles continued to compete with other motive systems into the early decades of the 20th century. However steam engines are less favored for automobiles, which are generally powered by internal combustion engines, because steam requires at least thirty seconds (in a flash boiler) or so to develop pressure.
The strength of the steam engine for modern purposes is in its ability to convert raw heat into mechanical work. Unlike the internal combustion engine, the steam engine is not particular about the source of heat.
A steam engine exhausting to atmosphere will have an efficiency (including the boiler) of 5% but with the addition of a condenser the efficiency is greatly improved to 25% or better. A power station with exhaust reheat, etc. will achieve 30% efficiency.
One source of inefficiency is that the condenser causes losses by being somewhat hotter than the outside world. Thus any closed-cycle engine will always be somewhat less efficient than any open-cycle engine, because of condenser losses.
Most notably, without the use of a steam engine nuclear energy could not be harnessed for useful work, as a nuclear reactor does not directly generate either mechanical work or electrical energy - the reactor itself simply heats water. It is the steam engine which converts the heat energy into useful work.