Copied from another site ..... Most OEM-style in-tank fuel pumps are equipped with a low-restriction inlet filter, often known as a strainer or “sock”. These filters often clip or screw onto the inlet side of the fuel pump.This is considered a coarse-element filter, and if you use an in-tank pump, this is a good low-cost alternative to an external coarse-element filter.However, we recommend that you still use a fine-element filter after the fuel pump to protect the fuel injectors.
It's in the tank in case of a rupture or leak - some guys have modified the location and have had problems with leaks (high pressure fuel near a heat source - yuk).