The secret to this question lies within the question itself.
Cooling fans simply cool the essential, heat producing components of a computer.
And if you are curious as to why this is necessary, simply put, heat destroys components once the temperature reaches a certain point. The temperature of catastrophic failure can vary from component to component, and vary with different architectures, and brands, but the theme resonates the same with all components. A safe, operable temperature must be maintained for a computer to function properly, and without components to cool a computer, most systems will inevitably overheat.