The basic internal combustion engine is a very simple machine, in principle. A piston moving up and down within a cylinder is connected (by a connecting rod (con-rod)) to a rotating crankshaft. The piston is forced downwards by the expandng gases of a fuel-air mixture burning in the cylinder space above it. This causes the crankshaft to rotate. The momentum of the rotating crankshaft then forces the piston back up again, allowing the next cycle to occur. Often, a heavy flywheel is attached to the crankshaft, to maintain the momentum of rotation.
Intake
The fuel/air mixture is first drawn into the crankcase by the vacuum that is created during the upward stroke of the piston. The illustrated engine features a poppet intake valve; however, many engines use a rotary value incorporated into the crankshaft.

Crankcase compression
During the downward stroke, the poppet valve is forced closed by the increased crankcase pressure. The fuel mixture is then compressed in the crankcase during the remainder of the stroke.
Transfer/Exhaust
Toward the end of the stroke, the piston exposes the intake port, allowing the compressed fuel/air mixture in the crankcase to escape around the piston into the main cylinder. This expels the exhaust gasses out the exhaust port, usually located on the opposite side of the cylinder. Unfortunately, some of the fresh fuel mixture is usually expelled as well.
Compression
The piston then rises, driven by flywheel momentum, and compresses the fuel mixture. (At the same time, another intake stroke is happening beneath the piston).
Power
At the top of the stroke, the spark plug ignites the fuel mixture. The burning fuel expands, driving the piston downward, to complete the cycle. (At the same time, another crankcase compression stroke is happening beneath the piston.)