system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What does actually happen inside a computer when it crashes or buffers?

Like if a program freezes, why does that happen
How does it actually manage to get stuck and reacts with a blue screen of death?
gpt
Crashing  can occur from many things but usually occurs when the program encounters 'exceptions.'

Modern programming often has 'functions'. Think of a program making toast. You rarely write a program to make the toast all in one go, you instead split it into functions. 

First you get bread. Then you get butter. Then you put the bread in the toaster. Then you turn it on. Then you wait. Then you take it out. Then you butter the bread. 

If any of those functions encounter an exception, it disrupts the flow of the other functions. What if there's a power cut - you can't turn the toaster on, which means every step beyond that is now useless - that can be thought of as an exception.

In programming, most of the time exceptions are planned for and the program should know how to handle them. If it doesn't, that's when it'll crash. It simply crashes because at one stage of a process, something unexpected happened and the programmer didn't implement anything to let it recognize that. 



Buffering is very different from crashing. A buffer in programming is just a medium between data when you move it. Think of the toast example - the plate is essentially a buffer - it's just there to hold the bread while you move it from the bag of bread to the toaster. 

A program may use a buffer to store outputs temporarily if an input can't receive them quickly enough, such as your browser buffering a video in advance because YouTube is sending you the video faster than you watch it.