The water's path changed because of the static electricity produced by combing the student's hair. When the comb was held close to the water, the static electricity attracted the water towards the comb, causing the water's path to change. Static electricity occurs when objects have an imbalance of positive and negative charges, leading to the attraction or repulsion of other objects with different charges.