(WHTM) — Pumping gas is something drivers always have to do, and it truly can be considered a necessary evil for many, especially with prices always going up and down at the gas station.

But, have you ever wondered while pumping gas into your car just how that pump works and how it knows to stop the flow of gas before your tank overflows?

The process is simple, according to howstuffworks.com. But first, where does the gas come from to get to the pump?

There are large gas tanks underneath all the service pumps at a gas station. Gas stations have two or three of these large tanks, that could hold several thousand gallons of gasoline.

But for the gas to come up from these tanks into the actual pump, it has to defy gravity. To do this, most gas stations use one of two kinds of pumps to get the gas from the storage tanks into the dispenser:

  • A submersible pump is submerged below the surface of the liquid. It uses a propeller-like device called an impeller to move the fuel upward into the pumps. Slanted blades on the rotating impeller push the liquid away the way fans use blades to push air.
  • A suction pump moves the gas using the principle of unequal pressure.  A pipe is inserted into the liquid. A motor above the fluid level removes enough air from the pipe to decrease the air pressure above the gasoline. When the air pressure inside the pipe is low enough, the gas climbs up into the dispenser.

But, how does the dispenser know when to stop pumping gas?

It starts when the customer removes the pump handle from the dispenser. This action activates a switch that starts the flow of gas.

As the gas level rises in the car’s gas tank, the distance between the dispenser nozzle and the fuel gets smaller. A small pipe called a venturi runs alongside the gas nozzle. When the end of the venturi pipe becomes submerged with the rising gas, it chokes off the air pressure that holds the nozzle handle open and shuts down the gas flow.

Sometimes, this shutdown can happen before the tank is full as the fast-flowing gas backs up on its way to the tank, causing the handle to spring back before the tank is full. Pausing for a few seconds will allow the gas to continue into the tank and the pump nozzle to start pouring gas again. If you try to keep pumping without pausing, you run the risk of causing the tank to overflow.

Knowing more about how gas pumps work won’t change the price, unfortunately. The Pennsylvania average was $3.97 per gallon Sunday.