system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: when you’re showering and the water suddenly turns icy cold or scalding hot for a few seconds before returning to its previous temperature, what’s happening?
gpt
Water temperature in the shower is determined by the mixing of cold water + hot water from the two different pipes in your house.

If the water pressure suddenly changes, like for say someone flushes the toilet, the cold water pressure in the shower drops and the temperature increases.

Most showers these days have valves designed to minimize this effect. Because suddenly having nothing but scalding water can be dangerous.

The valve mechanically senses the drop in pressure and adjusts the pressure of the other pipe to compensate, but there's still a fluctuation in pressure and temperature change. It just isn't as bad as without the valve.

Your valve might also be worn out.