This has happened to me a lot too. In my opinion there are two reason that it happens:
1. Other components in the computer are getting hotter and the CPU fan is trying to get the heat out;
2. The CPU fan is getting too much voltage.
The first and the second thing happened to me. The second thing happened when I opened my case, disconnected the CPU fan and cleaned all of the dust from it. When I plugged it back, the CPU fan started spinning very fast and POST during boot told me: "CPU fan overload". Then I just opened up my case, disconnected the fan and connected it again and everything worked fine. If the fan keeps spinning very fast, probably the second reason I mentioned occured. However there's probably more reasons out there that it occurs, but those were the ones I had. However if you don't know how to unplug your CPU fan, just do this (You can probably only do this with desktop PCs (I think it is possible to do it with a laptop too, but I dont recommend it (If you have a laptop, better hand it out to someone that is good with these kinds of things and he'll figure what's the problem))):
1. Disconnect the PC from any kind of power source.
2. Open up the case.
3. Check where the CPU fan is (If you can't disconnect it by removing the heat sink, just leave it and contact
someone that can do it for you and put the thermal paste onto the CPU again or maybe buy the thermal
paste yourself and then do it yourself (Thermal paste costs about 5-10 dollars) (If you don't know how to put
the thermal paste onto the CPU again, check this link: https

/www.wikihow.com/Apply-Thermal-Paste)
4. Once you've found the CPU fan, disconnect it, connect it again and check if it works.
If it still doesn't work, try going into your BIOS and checking if maybe the CPU fan is set to spin at its fastest rate. BIOS could of automatically set it to spin at its fastest rate during it was idle. If it's still not the case, try contacting someone that is good with these kinds of things and he'll figure it out.
I hope this helps in any way.