In many modern cars the fuel pump is usually electric and located inside the fuel tank. The pump creates positive pressure in the fuel lines, pushing the gasoline to the engine. The higher gasoline pressure raises the boiling point. 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. Another benefit to placing the pump inside the tank is that it is less likely to start a fire. Though electrical components (such as a fuel pump) can spark and ignite fuel vapors, liquid fuel will not explode (see flammability limit) and therefore submerging the pump in the tank is one of the safest places to put it. In most cars, the fuel pump delivers a constant flow of gasoline to the engine; fuel not used is returned to the tank. This further reduces the chance of the fuel boiling, since it is never kept close to the hot engine for too long.
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; this is much more common than the actual fuel pump failing. Modern engines utilize solid-state control which allows the fuel pressure to be controlled via pulse-width modulation of the pump voltage. This increases the life of the pump, allows a smaller and lighter device to be used, and reduces electrical load.
Cars with electronic fuel injection have an electronic control unit (ECU) and this may be programmed with safety logic that will shut the electric fuel pump off, even if the engine is running. In the event of a collision this will prevent fuel leaking from any ruptured fuel line. Additionally, cars may have an inertia switch (usually located underneath the front passenger seat) that is "tripped" in the event of an impact, or a roll-over valve that will shut off the fuel pump in case the car rolls over.
Some ECUs may also be programmed to shut off the fuel pump if they detect low or zero oil pressure, for instance if the engine has suffered a terminal failure (with the subsequent risk of fire in the engine compartment).
The fuel sending unit assembly may be a combination of the electric fuel pump, the filter, the strainer, and the electronic device used to measure the amount of fuel in the tank via a float attached to a sensor which sends data to the dash-mounted fuel gauge. The fuel pump by itself is a relatively inexpensive part. But a mechanic at a garage might have a preference to install the entire unit assembly.