Nowadays, the fuel pump is located inside of the gas tank. It creates positive pressure in the fuel lines, pushing the gasoline to the engine. The higher gasoline pressure raises the boiling point, and (possibly?) aids the fuel injection system which sprays the pressurized gasoline through nozzles to mix the gas with air. Placing the pump in the tank puts the component least likely to handle gasoline vapor well (the pump itself) farthest from the engine, submersed in cool liquid.
The fuel pump is generally on whenever the car's ignition switch is in the "on" position. Depressing the gas pedal results in valves opening in the engine rather than engaging the fuel pump. The ignition switch does not carry the power to the fuel pump, instead it activates a relay which will handle the higher current load. It is common for the fuel pump relay to become oxidized and cease functioning.