The steam engine uses the force produced by steam pressure to push a piston back and forth inside a cylinder. This pushing force is transformed, by a connecting rod and flywheel, into rotational force for work. It was used for locomotion and factories that needed reliable power. It basically powered the Industrial Revolution and was way more efficient than the engines at the time.
Before steam most factories ran on water, wind, or people. Water is good but a factory needs to be located near a river. The steam engine could be placed anywhere and provided reliable power to power large machines. The best part about it was that it was so efficient that it could be used to power trains and ferries. It was also easy to afford with the smaller amount of fuel it required. The steam engine made a lot of things in the industry easier and more affordable.