Vinegar is acidic, which means it has too many positive Hydrogen ions. Baking powder is base, which means it has too few positive Hydrogen ions. When you mix the two together, the two substances try to balance out their Hydrogen ions. In order for this to work, the baking soda needs to get rid of Carbon Dioxide which is released as a gas. This is the reaction that you see which can cause a bag to pop if you mix the two inside it.