Sometimes it can be because a program you are using is not compatible with your operating system or with other programs on the computer.
It may be that there are a lot of programs installed on your computer and the hard drive is starting to get full so that the computer can’t function quickly and you might be asking it to do too much all at the same time. It may be that there are a lot of programs open and it can’t manage to do many different tasks at once.
Computers can freeze or ‘hang’ for a variety of reasons.