The water in this phial was taken from Galadriel's fountain, which held the the light of a silmaril (Eärendil's star), which in turn preserved the light of the Two Trees of Valinor from before the first age.
Galadriel gifted the phial to Frodo, who added it to his collection of priceless magical treasures and used it to resist the one ring's influence. However, despite the phial belonging to Frodo, his companion Sam was the one to use it most frequently, holding the light while he slew the monstrous spider Shelob who had ensnared Frodo and was preparing to eat him, and using it to overcome the Two Watchers of Cirith Ungol to save his master Frodo once again.