- Defective hardware or power supplies.
- Incorrect programming.
tl:dr summary
The key is detecting and responding to WiFi outages. This necessitates periodically sending data in both directions through the socket and using a timeout at each end to detect loss of connectivity. Brief outages, unnoticed by devices with an OS, are very common and can lead to crashes unless applications are designed appropriately.
If I am correct it calls into question the resilience of most ESP8266 applications.
Comments and observations are extremely welcome.