History's first confirmed ice cream graced the court of Charles II in 1671. It was made using a special flavour, orange blossom, and one very special chemical ingredient that made ice cream without refrigeration possible in the first place.
Ask who served the first ice cream and you'll get a variety of answers. Sources name-drop everyone from the the Roman emperor Nero to Catherine de Medici. It's true that various members of history's elite enjoyed cooled or frozen drinks, but they hadn't figured out how to turn cream into ice. The first confirmed mention of "ice cream" came during a feast given by the British king Charles II.
According to legend, Charles paid the maker a yearly stipend to keep the recipe secret, but it got out by the 1680s, when the Grace Countess Granville wrote it down. In her recipe, she revealed what was probably the first ever flavour of ice cream, telling people to "sweeton" their "creame" and then add "orange flower water." In other words, orange blossom. Orange blossom ice cream continued to be the only available flavour until the very end of the 1600s, at which point flavours like chocolate, lemon, and pumpkin joined the party.
And what an explosive party it was. We know now that mixing ordinary salt with ice is the first step to making our own ice cream at home. It's a fast process that needs a simple chemical. Put a container filled with cream, possible an egg or two, sugar, and flavouring into a big bucket of ice and add some salt to the ice. As the salt mixes with the ice, it lowers its freezing temperature -- which is why salt gets poured onto roads around the world every winter. Ice doesn't pop back to its liquid state spontaneously. It needs energy in the form of heat. That heat is provided from the ice around it, and from the cream mixture.
People in the 1600s weren't aware of this. Instead of using salt to lower the temperature of the mixture, they used saltpeter. Saltpeter, KNO₃, was first used for making fireworks and gunpowder. It's possible that this is how people stumbled upon its freezing properties.
Or it could be that early alchemists were experimenting with saltpeter and found out it froze substances. It's even possible that people stumbled on the secret of ice cream while looking to preserve their chastity -- saltpeter was rumoured to suppress the libido.
All we know for sure is that, in 1558, an Italian scholar and playwright called Giambattista della Porta published a book called "Natural Magick" and recommended that people mix saltpeter and ice, then dip a vial of watered wine into the mixture, rotating it until it "congealed" to make a kind of wine slushie. From there, the secret of icing drinks slowly spread across Europe until, 113 years later, ice cream emerged as a royal delicacy.