Motorcycle engines work the same way as car engines. They consist of a piston, cylinder block and head, which contains a valve (valve). The piston moves up and down the cylinder block, driven by a mixture of fuel and air mixture that has been ignited by spark (spark plug).
The valve opens and closes to allow the mixture of fuel and air to enter the combustion chamber. The piston moves up and down, turning the crankshaft, which converts the energy from the piston into a rotary motion.
The rotating power of the crankshaft is transmitted to the rear wheels of the motorbike after going through the "transmission line".
Simple: The drive energy from combustion is converted into a straight motion with the piston up and down. Then this straight motion is transformed into a rotating motion (because the wheel requires circular motion, not straight) by the crankshaft. In the end after going through the transmission and chain / CVT, this style moves the wheels.
Explosion energy -> piston straight motion -> rotational motion crankshaft -> transmission -> wheel.