Windows can shut down unexpectedly because of many reasons; some of the causes can be a power failure, hardware, or software error. This kind of issue can be rectified by analysing Windows logs and performing troubleshooting as per issue diagnosis.