In both the ancient and modern world, the tradition of breaking a bottle over the bows of a new ship has very strong ties to religious traditions of blessing and protection. Many ancient cultures had a tradition of sacrificing wine or other liquids (blood, milk, water) to the gods for protection or favour. Champagne became more and more popular throughout the 18th and 19th centuries as a symbol of luxury and richness. As such the ordinary seaman had little chance to sample their delights, as alluded to in this Charles Grave (1886-1944) cartoon.
BLUEJACKET: “Pull yerself together, ‘Erbert. We licked all the champagne off ‘er bows when she was launched.”