A fuel pump pulls gasoline from the tank, guiding it along a pipe to the carburetor. Some fuel pumps are electric, mounted near or in the fuel tank, while others operate mechanically in concert with the engine. Either way, the fuel pump is what gets the gasoline where it needs to go.
If the fuel pump is mechanical, the crankshaft drives the camshaft, which in turn operates the pump. A cam goes under a lever and pushes it up with each turn. The other end of this lever connects to a rubber diaphragm, which makes the floor of the fuel pump. Each turn pulls the diaphragm with it, building suction that drags fuel up out of the tank. Each rotation of the shaft causes more suction of fuel into the pump. As the diaphragm keeps moving, gas goes through the chamber into the carburetor.
Electric fuel pumps also have a valve and diaphragm. However, a solenoid, or electromagnetic switch, pulls the diaphragm instead of the camshaft. The solenoid exerts an attraction on the iron rod that moves the diaphragm, bringing fuel into the chamber. When the rod reaches the end point of its motion, it pushes a set of contacts apart, relaxing the tug on the diaphragm.