Zener voltage for protection of GPIO

One was included in this video: Here is why MOSFET drivers are sometimes essential! || MOSFET Driver Part 1 (Driver, Bootstrapping) - YouTube at 8:40

and then I saw one on this page: https://www.rs-online.com/designspark/how-does-zener-diode-do-overvoltage-protection-in-circuit in section 3.

On that page in section 3, it's moved before the resistor. I thought this would be better because then that resistor limits the current through the diode in the event of a drain-to-gate short. The reason for the zener in the video isn't explained but I figured it might be due to some induced voltage that happens when the MOSFET starts conducting? He just says in the video "occuring overvoltages" and doesn't explain how they might be generated. If a MOSFET does fail closed, I would like the microcontroller to be protected though.