Factor #1 is the battery. It's far and above the biggest safety feature. Factor #2 is that nobody else makes electric cars as big as Tesla. The Model 3 is 9" longer than a Leaf and a full 21" longer than a Bolt. That means WAY more crumple zone -the crumple zone is the first thing to go in a small car, making room for legs- and that's the biggest safety difference between cars.
I think you're also underestimating the impact of the battery. The center of mass makes it practically impossible to roll, a huge source of injuries and deaths. It's also incredibly resistant to pole and many vehicle intrusions, since those happen either on or just above the battery, which is extremely strong compared to normal cars.
The battery also lets almost the entire front and back of a Tesla be used as a crumple zone. Nobody else is really doing this. The Bolt has the second best battery among EVs for sale currently, and it's still shaped and positioned pretty much like a gas tank. It blocks a lot of crumple zone. The engine in any normal car is totally incompressible and massively limits the crumpling- worse, the higher end, larger cars will still have correspondingly larger engines, limiting safety. They might have a foot or two of crumple distance, while the entire hood of a Tesla can absorb impact. Even the motor can snap up and back if needed.
In a Tesla, you automatically combine 3x the shock absorption with an extremely strong safety cell and the strongest anti-rollover feature of any car. It's zero surprise they do incredibly well in crash tests.