Heatstrokes can occur when, under prolonged exposure to high temperatures, the body begins overheating and is unable to regulate temperatures.