>>13918132Fever occurs when inflammatory signal molecules (known as cytokines, for example interleukin-1) released by white blood cells at the site of injury, are sensed by your hypothalamus (part of which constantly monitors the content of your blood to aid the hypothalamus in body homeostasis). Your hypothalamus is also the site where body temperature is regulated. The "thermostat" of the body is raised, so at the start of the fever you shiver and feel "cold" so that you raise your own body temperature until it reaches a new "set point"
So the fever is produced by cytokines which can be released after any inflammatory response, these cytokines can be released by white blood cells and even some tissue cells.
Now, does fever have a teleological role; does it theoretically improve killing of foreign microbes? Yes perhaps in some cases, but if it were significant enough then paracetamol/acetaminophen, by reversing your fever, would have a detrimental effect on your body killing the pathogens. But we don't really see that in reality, so the effect of a fever is probably minimal. The actual mechanism of a fever likely originated in lower animals in which the act of raising body temperature was a more significant part of the immune response.