Relays switch very slowly, unsuitable for most PWM applications. Thats reason
MOSFETs are used. You can use relay for simple on off switching. Note there
are specialized relays that switch fairly fast, but no low cost, still PWM application
not suitable.
When you switch a power MOSFET you are looking into a large C load, so either
you run PWM at low rates, frequency, or you use a MOSFET gate driver circuit/
IC.
Regards, Dana.