Salts in hard water and in dairy ingredients, or the addition of a small amount of table salt (sodium chloride), speed up and strengthen the coagulation of egg proteins. Dairy proteins also likely interact with egg proteins, firming up the gel. Imagine egg custard made with water instead of milk. The custard would be very soft and barely set. Using hard water and a small amount of salt to replace the milk restores much of the lost gel strength—but none of the rich dairy flavor.
Protease enzymes break down egg proteins much as they break down gelatin protein. Try to make baked custard with added uncooked pineapple, which contains active protease, and the custard will not set. Cook the pineapple first, inactivating the enzyme, and the intact egg proteins in the custard will coagulate.