In the beginning, gas powered vehicles used a carburetor to get gas into the engine. This worked well, but when fuel injection came along, things changed quickly. Fuel injection, especially electronic fuel injection produces fewer emissions and greatly increases gas mileage.
The carburetor was an ingenious invention in itself. Your car's engine has 4 cycles, and one of them is a "suck" cycle. Put simply, the engine sucks (creates extreme vacuum inside the cylinder) and when it does, the carburetor was there to let the right amount of gas and air get sucked into the engine. While great, this system lacked the precision of a pressurized injection system.
Enter fuel injection. Your engine still sucks, but instead of relying on the suck, fuel injection shoots exactly the right amount of fuel into the chamber. Fuel injection systems have gone through a few evolutions, adding electronics was a big step, but the idea has remained the same: an electrically activated valve (the injector) spraying a metered amount of fuel into your engine.
Single port fuel injection systems spray gas into a central intake, that then sucks the gas and air into the engine all at once. This was sort of an in-between invention that combined a carburetor and fuel injection. Most European and Japanese cars skipped this step and went directly to multi-port fuel injection, while American makes used it.
Multi-port injection is still widely in use today. So far it's the most efficient method of metering gas into the engine. Multi-port fuel injection, also known as MFI, consists of an injector for each cylinder in the engine. This injector sprays fuel directly through the intake valve or valves into the combustion chamber. Each injector is activated separately by wire. Early versions of this system, such as CIS, Jetronic and Motronic utilized a fuel distributor that metered fuel to the injectors through separate fuel lines. Later versions utilize a single fuel line that connects to a fuel rail on top of the engine. The injectors take gas from the central fuel rail and squirt it into the engine when told to do so.
With diesel engines making a comeback, there has been more focus in recent years on diesel efficiency. Direct injection diesel engines utilize an injector that sprays fuel directly past the glow plug into the combustion chamber. The technology developed here allows for more complete burning of the diesel fuel, and thus better efficiency and less stinky smoke discharged into the atmosphere.
How do fuel injection systems know how much gas to squirt anyway? Somewhere along the line, somebody (probably at Bosch) realized that you could measure how much gas your engine needed by how much air it was sucking in. Once your engine starts, the measuring of air begins. Early fuel injection systems used a vane system, which was basically a flap inside a tube, to measure how much air was being sucked. Later systems use a "hot wire" to figure it out. When you turn your engine on, the wire becomes red hot. As air is sucked past this wire, it gets a little cooler. The car's brain measures exactly how much cooler it's getting and uses this number to figure out how much air it's sucking. Then it squirts the correct amount of fuel into the engine.
There are lots and lots of variations to fuel injection systems. We've got electrnic fuel injection, mechanical fuel injection, systems with one oxygen sensor, systems with four oxygen sensors ... but the basics remain the same.