What role does a FET play when working with GPIO pins on a Raspberry Pi?
The GPIO pins on the Raspberry PI can only source or sink about 10mA and are damaged when exposed to voltages above 3.3V.  The MOSFET effectively acts like a relay (voltage controlled switch) allowing the circuit to control mode than 3.3V and provide mode than 10mA to the load while being driven by a GPIO pin.  Note that you can't drive a typical relay from a GPIO pin because the relay coil requires more than 10mA.

Bipolar transistors can also be used to accomplish this function.  MOSFETs are often preferred because their effective resistance when on can be much lower than a bipolar transistor (allowing them to handle more current and generate less heat at the same current).  MOSFETs also require very little control current (for slow switching speeds) and can switch a very high current from a change in voltage.  Bipolar transistors are current amplifiers so there is a ratio (called Beta) between the input current and the output current.  This ratio is limited, so it is often necessary to use multiple stages of bipolar transistors to amplify the 10mA drive current into what is required to drive an actual load.

MOSFETs have their own set of challenges.  Most N-Channel MOSFETS require the voltage difference between the gate and the source to be 5-8V in order to fully turn on, which is needed to switch high currents efficiently.  Logic level MOSFETS are available with lower voltage drive requirements (reduced variety and often increased cost).

EDIT: RPI GPIO current limit appears to be 16mA per pin with a total limit of about 50mA so you need to limit the current to a lot less than 16mA if you are using several GPIO pins.