Leaking fuel is a hazardous and wasteful problem for a vehicle to have. Manufacturers know this, and to combat the problem they have implemented a number of simple ways to prevent fuel from leaking out of the fuel system:
O-rings: Small rings made out of rubber or similar flexible material. They are extremely useful at preventing liquid from leaking out of lines, hoses, and fittings. In the fuel system, O-rings are used to keep fuel from leaking around the fuel injectors.
Gaskets: Rubber seals that precisely match the outline of the part they are applied to. For instance, the gasket between the fuel tank and fuel pump prevents leaks because it is made to seal off the perimeter of the hole in the gas tank that the pump mounts to.
Hard gas lines: Much more durable than rubber hoses, hard fuel lines are used on many cars because they last a long period of time and they can withstand the abuse of being under a moving car all the time. Rubber hoses are used in the fuel system as well, but they are in accessible areas where they can be regularly inspected.
Despite all of this, gas leaks do happen. Gas is dangerous as a liquid and it produces dangerous fumes as well. A leak must be fixed as soon as it is noticed.