In general, a piston is a sliding plug that fits closely inside the bore of a cylinder.
Its purpose is either to change the volume enclosed by the cylinder, or to exert a force on a fluid inside the cylinder.
Internal combustion engine
A piston in an internal combustion engine has some piston rings. Usually there are two compression rings as a seal between the piston and the cylinder wall, and one or more oil control rings below the compression rings. The head of the piston can be flat or bulged or otherwise shaped. Pistons can be forged or cast. The piston is an important component of a piston engine and of hydraulic and pneumatic systems.
Piston and connecting rod
In an Otto or Diesel engine, the head of the piston forms one wall of an expansion chamber inside the cylinder. The opposite wall, called the cylinder head, contains inlet and exhaust valves for gases.
As the piston moves inside the cylinder, it transforms the energy from the expansion of a burning gas (usually a mixture of petrol or diesel and air) into mechanical power (in the form of a reciprocating linear motion). From there the power is conveyed through a connecting rod to a crankshaft, which transforms it into a rotary motion, which usually drives a gearbox through a clutch.
Each piston is located inside a cylinder, into which a fuel and air mixture is introduced, and then ignited. The now hot gases expand, pushing the piston away. The linear movement of the piston is converted to a circular movement via a connecting rod and a crankshaft. These engines are known collectively as internal-combustion engines, although internal-combustion engines do not necessarily contain pistons.