The pump creates high pressure to push fuel, that is contained in the tank, into the injection system. Even after the engine is shut off, the fuel pressure stays sustained. That is why, before you start replacing, you need to release the pressure, as otherwise it may lead to an explosion.