In hydraulics the pumps are positive displacement pumps i.e. they have parts which due to their relative movement change a volume and ex pulse the oil from it to the system.
A relative movement means gaps, and gaps allow leaks due to generated pressure. This means that part of compressed oil goes back to low pressure but being compressed when it will flow to low pressure the contained energy will transform in heat.
The higher the back flow the higher the energy losses and the higher the temperature increase of the reservoir contend. Since worn pumps have higher losses and thus higher temperatures are measured the oil temperature evolution is also a measure of the components wear.