I think that means that the water helps us maintain our body's temperature steady.
As you know, the normal temperature of our body is about 37 C. That means that the water that is in our body is about 37 C too. Now, lets say that I go at a cold place. My body's temperature will start falling below 37 C. The water in my body (which temperature is about 37 C) will start providing heat to my body (and water's temperature will start falling). But since water's temperature isn't changed easily, the heat provided will be plenty to maintain our temperature (almost) steady and avoid a sudden temperature drop.
The same thing happens if I go to a hotter place. Water will start absorbing the body's extra temperature, and we will avoid a sudden temperature increase.
I just don't understand when it knows to do them.
It doesn't know when to do them. At the end of the day, it is a molecule, and it doesn't "know" anything. Due to its chemical make-up - two hydrogen molecules and one oxygen - it can absorb energy and release energy once those bonds have been broken. This is very much the same with any molecule on this planet.
I think you are mistaken. We talk about "water providing heat to living organisms". None living organism has yet found absorbing heat from breaking water molecules (I think...).