Fever has been described in teaching texts as assisting the healing process in various ways, including:

increased mobility of leukocytes;: 1044 
enhanced leukocyte phagocytosis;: 1030 
decreased endotoxin effects;: 1029  and
increased proliferation of T cells. : 1030 : 212

Advantages and disadvantages
Having a fever response in response to an infectious disease is generally regarded as protective, whereas fever in non-infections may be maladaptive. Studies have not been consistent on whether treating fever generally worsens or improves mortality risk. Benefits or harms may depend on the type of infection, health status of the patient and other factors. Studies using warm-blooded vertebrates suggest that they recover more rapidly from infections or critical illness due to fever. In sepsis, fever is associated with reduced mortality. Pathophysiology of fever induction
Hypothalamus
Temperature is regulated in the hypothalamus. The trigger of a fever, called a pyrogen, results in the release of prostaglandin E2 (PGE2). PGE2 in turn acts on the hypothalamus, which creates a systemic response in the body, causing heat-generating effects to match a new higher temperature set point. There are four receptors in which PGE2 can bind (EP1-4), with a previous study showing the EP3 subtype is what mediates the fever response. Hence, the hypothalamus can be seen as working like a thermostat. When the set point is raised, the body increases its temperature through both active generation of heat and retention of heat. Peripheral vasoconstriction both reduces heat loss through the skin and causes the person to feel cold.
The most common pyrogens are endotoxins, which are lipopolysaccharides (LPS) produced by Gram-negative bacteria such as E. coli. But pyrogens include non-endotoxic substances (derived from microorganisms other than gram-negative-bacteria or from chemical substances) as well. The types of pyrogens include internal (endogenous) and external (exogenous) to the body.The "pyrogenicity" of given pyrogens varies: in extreme cases, bacterial pyrogens can act as superantigens and cause rapid and dangerous fevers. Endogenous
Endogenous pyrogens are cytokines released from monocytes (which are part of the immune system). In general, they stimulate chemical responses, often in the presence of an antigen, leading to a fever. Whilst they can be a product of external factors like exogenous pyrogens, they can also be induced by internal factors like damage associated molecular patterns such as cases like rheumatoid arthritis or lupus.Major endogenous pyrogens are interleukin 1 (α and β): 1237–1248  and interleukin 6 (IL-6). Minor endogenous pyrogens include interleukin-8, tumor necrosis factor-β, macrophage inflammatory protein-α and macrophage inflammatory protein-β as well as interferon-α, interferon-β, and interferon-γ. : 1237–1248  Tumor necrosis factor-α (TNF) also acts as a pyrogen, mediated by interleukin 1 (IL-1) release. These cytokine factors are released into general circulation, where they migrate to the brains circumventricular organs where they are more easily absorbed than in areas protected by the blood–brain barrier. The cytokines then bind to endothelial receptors on vessel walls to receptors on microglial cells, resulting in activation of the arachidonic acid pathway.Of these, IL-1β, TNF, and IL-6 are able to raise the temperature setpoint of an organism and cause fever.