What is the purpose of pistons in an engine?
The piston moves in an out of a cylinder, moving the air, fuel, and exhaust about and extracting work from the burned fuel and air. Without the piston, there would be no way to obtain energy from the gasoline.