Series arc fault on the extension
Is the short answer. There was a poor connection (where is obvious: it's Ground Zero of destruction) and that connection started to arc. Similar to arc welding, arcing makes a LOT of heat.
Looks to me like a wire nut inadeqately torqued. They require "gorilla tight, not monkey tight", especially the big ones. One problem with wire nuts is the inability to specify a screw torque - which a) science has revealed is important at all terminal sizes, and b) electricians are proven to be bad at.
I see absolutely no twisting action on that nut. People often believe wire nuts are "caps" only there to insulate. The twisting is essential to crush the wires into each other.
Contributing factor #1: the splice
Wire problems almost always happen at terminations. When a hardwire connection is continuous from breaker to EVSE ("charger"), it has thermal protection on both ends. Most EVSEs have a thermosensor at the power terminals and are actively monitoring temperature there. This arrests arcing before it can be serious.
Breakers have a passive way of monitoring terminal temperature. They have 2 modes of trip: an instant-trip operated magnetically, and an inverse-time delayed trip operated by passing current through a bi-metal strip. Thermal rise in a wire is the square of current, so this works nicely. When the terminal screw on a breaker heats up, that heat is telegraphed along the current pathway to the bimetal strip, heating it externally and causing the trip.
This usually happens only after enough arcing has happened to make the problem very obvious.
However with a midpoint splice, there is no thermal management at that splice.
Contributing factor #2: The Fastest Charge Possible (tm)
Technology Connections covers this beautifully in their "Guide to home EV charging" video (a must-watch)...
"Don't just go for the Fastest Charge Possible: It's expensive, and may come with headaches you didn't bargain for." And in the experience of the EV community, that's usually this. Such extreme power, especially when run at thermal limits of the wire, WILL find every flaw in the wiring and make it crispy.
Let's do some quick math on home charging. If you go 15,000 miles a year, doing a mediocre 3 miles/kWH, that's 5000 kWH a year that needs to go into the car. That is 13.7 kWH per night. Assuming conservatively 10 hours a night of charging with no downtime on weekends to catch up, that's 1.37 kWH/hour == 1370 watts. Regular old "level 1" charging is 1440. So that works out on the average especially with a little more than 10 hours a night. The only reason most bother with "level 2" charging is imagining transient events bigger than battery capacity.
So one way to mitigate this is simply turn down charging amps. Normal wire heating is the square of amps, so e.g. a drop from 48A to 24A (still overkill, still fills the car overnight) will reduce heating by 75% and reduce the degree to which arcing starts.
Indeed we've seen multiple reports of people who installed charging for their plug-in hybrid (which pulled 12-16 amps) and it served them well for years, until they brought in a battery EV which pulled 32A and it caught fire the first night.
Not OP's problem, but sockets exacerbate this problem - that's why we warn against them generally and cheap under-$30 range outlets in particular.
Contributing factor #3: No arc-fault detection
Arc fault detection involves analyzing the AC voltage and current waveform to look for telltales of arcing - think of that "crinkle-crunch" sound of hooking up speakers with the amplifier turned on. The algorithm suits GPU style microprocessors, such as those in video cards, Bitcoin miners and AI.
Development of affordable AFCIs didn't really line up with the timeline of the EV charging standards being developed. In addition, the industry was (and is!) being pressured to reduce the parasitic power usage of EV chargers e.g. Energy Star. So there's no market interest in providing series arc fault detection in the "charger" (EVSE). Thanks, Energy Star!
You can do it at the circuit breaker, but that segues us back to the "how fast do you really need to charge" discussion, because the largest generally available AFCIs are 20 amps, giving 3.84 kW charging rate, half the 7.7 kW rate of typical mobile chargers and 1/3 the maximum of wall units. And that brings out people's anxieties.
Contributing factor #4: Box not grounded.
Code requires a metal box be tied to ground. I see only 2 ground wires in that nut, so clearly the (hack?) electrician didn't run a pigtail to the box. I would've mounted actual ground lugs on the grounding screw.
Had they done so, the first wire to be bared by insulation melting would have contacted the box and tripped the breaker a lot sooner. As things were, it energized the box until melting proceeded far enough to melt the OTHER hot wire and short them.