Tapping on the top of a newly opened beer bottle can create a foamy eruption of booze — and get you disinvited from future house parties. When the compression wave hits the bottom of the bottle, the wave transmits its force back up through the liquid as an expansion wave.
As alcohol under the ball dries up it sticks to to bottom preventing user to pour it. A quick hit to the bottom dislodges it enabling it to pour.
If proteins are responsible, Sopina and co suggest that beer could be treated to prevent foaming by denaturing the relevant proteins, perhaps by heating the beer before it is cooled. However, the proteins play an important role in the flavor and mouthfeel of beer.