Crashes can occur for various reasons, for example, the AI doesn't know how to place mines, and because of this, units with fire traps crash (apparently, the heroes have a spell that's prohibited). Crashes also occur with traps and invisible units.
And now, the most annoying crashes – too many heavy objects overload the memory, and the game crashes. The penultimate version of the Lizardmen in RTF crashed due to the enormous model of the forest. A mod for new recruitment backgrounds personally crashes on my potato PC in the middle of the game (and the game also takes a long time to load these backgrounds).
There are probably other reasons, but I don't know them all.
Added 4 minutes later
Hmm, although now I remember (I admit, I haven't played Heroes in a long time, although I really like the game) that on very large maps, the vanilla game crashed for me, but I don't remember why or what caused it anymore...