During infection, immune signals make the brain raise its temperature set point, so you feel cold and shiver to warm up. Fever reducers dampen that signal and improve comfort, but they are not treating the infection.
Fever and heatstroke both mean a high temperature, but the mechanisms differ: in a fever the set point is raised; in heatstroke heat production outruns heat loss, core temperature climbs above the set point, and temperature regulation fails. Heatstroke is an emergency that needs the body cooled right away.