What is the difference (or causes) between a program that crashes and a program that hangs (becomes unresponsive) in C++?

For sure, accessing invalid memory causes a program to crash. Deadlock in threads may cause a program to hang. What are the other causes?

Does exhausting all memory causes a program to hang? or crash? I'm a bit confused between the differences and their causes.