Water freezes and ice melts at a temperature of 32 degrees Fahrenheit (0 degrees Celsius). Salt lowers the freezing point of water to -22º F (-30º C). That’s why we put salt on icy sidewalks and roads in the winter – the salt encourages the melting process.
When you added salt to your bag of ice, the temperature dropped below 32ºF and stopped around 14ºF (-10 C). To keep melting the ice, more heat is needed. When you put your bag of ice cream mix into the bag of melting ice, heat from the ice cream bag flowed into the ice and salt water. That made the ice continue to melt, and it made the ice cream mix get colder. Eventually, the water and ice cream mix started to freeze. And what did you get? Ice cream!