So normally current passes through a transistor/MOSFET in just one direction. If current goes in reverse, bad stuff will happen. With motors, there is a lot of noise. If the motors are suddenly torqued, they apply a voltage to the power lines (noise).
Sometimes this noise is so large that it sends a current in reverse through the transistor/MOSFET, thereby frying it. So what a flyback diode does is allow this 'flyback' current to bypass the transistor and instead go back to your battery.
Does that help?