Ahh ha! I have an answer!! Apparently it works like this...
Drinks cans are pressurised so that the gas stays dissolved in the drink. Shaking a can causes some of the gas to escape, in an closed can it has nowhere to go and so it tends to cling to the metal sides, top and bottom of the can.
If you open a can in this state then you release the pressure, and the compressed gas expands. Gas bubbles on the sides and bottom will "push" on the liquid as they expand, of course the liquid has nowhere to go except up and out of the can! All over your nice clean shirt!!
Tapping the top of the can disslodges the bubbles from the sides and bottom and causes them to rise to the top. Now when you open the can the bubbles still expand, but the excess gas just escapes up and out of the opening itself, instead of forcing the liquid out!
Top Tips today bought to you by science in action!
Brushess off lab coat, and hangs up safety goggles....