Heat builds up rapidly in the metal you’re grinding, so cooling it occasionally lets you work longer. It’s also useful when sharpening cutting tools like chisels, which are heat-treated (tempered) when they’re made. If they get too hot, you could remove the temper, and they could go blunt very quickly. Dipping the tools in water reduces the chances of this happening.