Carnival has always been also a way of flirting, getting sexes together.
One way of courting (making passes at) women was the unusual throwing of eggs filled up with rose water. And it became a trend.
Merchants were selling different kinds of perfumed eggs, and young masked men were going around town, showing their appreciation for the ladies they liked most, throwing these perfumed eggs in front of their houses.
Of course the joke could get wild, so eggs also went toward the spectators, the ladies' husbands, and finally to the ladies themselves …