When (most) materials are heated they expand.
If you have a hydraulic system in which fluid is "locked in" such as a parking brake system, such expansion can create pressure sufficiently high to burst the pipes. A thermal relief valve is simply a pressure relieve valve that is used to relieve excess pressure before the pipes burst.