In this video Phil illustrates the process he uses at Grin for identifying and replacing shorted mosfets in an ebike motor controller.
Mosfet usually fail when they have to deal with sustained high amperage that generates more heat than they can dissipate. They can also fail from exposure to excessive voltages on the wrong pins or electrostatic discharge.
A well engineered controller will use temperature sensors to limit the current through a mosfet if as it overheats to prevent a catastrophic failure in use, but many systems don’t have this intrinsic protection and instead on the motor and bike parameters to generally not overstress the component in normal use. As a result, it’s not uncommon for people who push their ebike systems to the limit to find themselves dealing with mosfet repairs in the process.
When they fail it is almost always in a short circuit. On a bike with a direct drive hub motor this results in a heavy cogging and chugging whenever the wheel is turned.
Fortunately a repair is often possible as Phil shows. If it is only one mosfet that is blown, the odds are good that a mosfet replacement alone will fix things. But if both the high and low side mosfets of a motor phase our blown, then that usually indicates damage that has also propagated down to the mosfet drivers and other components, and the odds are lower that a mosfet replacement alone will fix the controller.
There is more ebike troubleshooting information available here