"a hit with an explosive sound," c. 1400, of imitative origin. Meaning "flavored carbonated beverage" is from 1812.
A new manufactory of a nectar, between soda-water and ginger-beer, and called pop, because 'pop goes the cork' when it is drawn. [Southey, letter, 1812]
Sense of "ice cream on a stick" is from 1923 (see popsicle). Meaning "the (brief) time of a 'pop'" is from 1530s. Pop goes the weasel, a country dance, was popular 1850s in school yards, with organ grinders, at court balls, etc.