An engine burns best near about 15 parts air to 1 part fuel by weight; richer mixtures make more power and run cooler, leaner ones save fuel. The fuel system's job is to meter fuel to match the air.
Float carburetor
A float and needle valve keep the fuel in the float bowl at a steady level.
Air through the venturi makes low pressure at the main discharge nozzle, which draws fuel through the main metering jet.
The throttle valve (a butterfly) sets how much air, and so power.
An idle system feeds fuel when the throttle is nearly closed.
An accelerator pump squirts extra fuel when the throttle opens quickly, so the engine doesn't stumble.
An economizer (power enrichment) adds fuel at high power, which helps cool the cylinders.
The mixture control matters because air gets thinner with altitude while the carburetor keeps metering by volume, so the mixture gets richer as you climb. The pilot leans it, often using exhaust gas temperature as a guide. Idle cutoff stops fuel flow to shut the engine down cleanly.
Fuel injection
Most aviation fuel injection is continuous flow: a fuel control meters fuel by airflow and sends it to a flow divider (the "spider"), which feeds a nozzle at each intake port. Fuel is spread more evenly than with a carburetor, and since fuel isn't evaporated at the throttle, there's no carburetor ice. Hot engines can be hard to restart because the fuel in the lines turns to vapor.
Abnormal combustion
Detonation is the mixture exploding all at once after the spark instead of burning smoothly, from too lean a mixture, too low an octane fuel, too much heat or pressure. Preignition is the mixture lighting before the spark, from a hot spot like a glowing carbon deposit or an overheated plug. Both can destroy pistons quickly. Use at least the fuel grade on the placard: 100LL (blue) is the most common avgas, and unleaded avgas and auto fuel can be used only where approved for that engine and aircraft.
Practice
What does a carburetor's accelerator pump do?
More info
Quick reference
Float and needle valve
Keep fuel at a steady level in the bowl.
Main metering jet
Meters fuel to the discharge nozzle.
Accelerator pump
Extra fuel on sudden throttle opening.
Economizer
Extra fuel at high power for cooling.
Flow divider
Splits injected fuel between the nozzles.
Detonation / preignition
Explosive burn after the spark / lighting before it.