First, let me say than gasoline vehicles are more likely to catch fire than an electric vehicle. And, a hybrid fits in this list — you may have a battery but a hybrid is more likely to catch fire because of the gasoline part of the car than the battery part. OK, on to fires in true EVs.
There are multiple battery chemistries used in EVs. What was the most common was batteries which used lithium, nickel and cobalt plus some other materials. In China these are referred to as lithium ternary batteries. The other category are lithium iron phosphate (LFP) batteries. Lithium ternary batteries were the most popular because they had a higher energy density plus LFP batteries were covered by a patent. The patent has now expired which has encouraged multiple companies to work on improving the energy density of LFP batteries.
What’s important here is that LFP batteries tend to be stable even if damaged. There are more advantages of LFP batteries but not going up in flames is pretty important.
The Electric Viking does a good job of covering this issue.