GE Dryer, Model GTDX100EM1WW Burnt Wiring
It looks as if the red connector in the first photo may not be the original, but a past DIY repair. I may be wrong, too.
Either way the wire should have a retaining clip close to the connection. The plastic grate in photo 1 most likely has a clip close to the terminal. If not zip tie the wires to a stable part of the dryer.
This most likely occurred due to vibration and the wire not being secured. If necessary solder the spade terminal to the wire for the most secure connection.