Throughout the great age of sea exploration, ship captains were constantly struggling to find a way to easily (and safely) satisfy the demands of sailors for a daily allowance of alcohol and, at the same time, to make the water stored aboard the ship palatable enough to prevent the crew from turning on them over accusations of rotten water and sparse alcohol.
The two concerns became particularly pressing as sea voyages lengthened. Beer didn’t keep long enough to survive long voyages (nor was it easy to store adequate quantities), water barrels would grow quite slimy, and the stored water would take on foul odors. To combat this, British Vice Admiral Edward Vernon introduced a new drink in 1740: a mixture of water and rum.
Why mix them and why did the mixture take on the name “grog”? Mixing the two together was a clever idea. First, it made stale water taste much better. More importantly, however, it would spoil faster than straight rum and thus would prevent crafty sailors from saving their daily ration of rum for days (or even weeks) in order to drink it all at once and enjoy a bit of high seas drunkenness (often coupled with a bit of disorderly conduct).
As for how it came to be called grog, Vice Admiral Vernon wore a coat made of grogram cloth, the sailors called him “Old Grog” in reference to the cloth, and soon they were calling the rum and water mixture he created “grog” in reference to him.