A water line to the refrigerator is necessary for a unit with a built-in water dispenser and/or an automated ice maker. The line supplies the water for the automatic dispensing of cold water or making of ice.
The water supply lines to refrigerators are installed in many homes during their construction. When homes don’t have this plumbing feature, the situation can be addressed by plumbing an ice maker installation kit under the sink. A gallon of water sitting on top of the refrigerator may work, but that is not practical over the long run, as the gravity may not be able to supply the minimum pressure for the water to move into the unit.