2-stroke engines have more horsepower, but poorer fuel efficiency than 4-strokes. Why? Because 2-strokes repeat the process of combustion more than 4-strokes.
A 2-stoke engine lacks the kinds of valves a 4-stroke has, so air intake and exhaust of fumes are handled entirely by the motion of the piston (ie the 2-stroke is simpler, and was usually used in the early days of motorcycles).
Soichiro Honda thought to improve fuel efficiency of his motorbikes by fitting them with 4-strokes.
A 4-stroke has special valves. There’s a valve for letting in fuel and air (into the cylinder), and another valve releases fumes (exhaust gases) after the mix of fuel and air has been ignited by the spark plug (and under compression provided by the piston). They open at different times.
A 2-stroke just has openings to let in fuel/air and let out fumes. The openings are covered by the piston at different times, so they are open at different times to let stuff in or out.