My dad puts peanuts in root beer.
Why Peanuts Appear To Dance In Beer, A Scientific Explanation

The same reason anybody else dances: because they’re wasted. Or you can read this recently published long-winded academic paper detailing the physics involved in dancing beer nuts. Basically, as the beer degasses the bubbles adhere to the nuts, lifting them to the surface, the bubbles pop, and the nuts sink again until enough bubbles carry them foamward again. Basically exactly what you already thought. So yeah, you were correct. Not unlike how you thought that screencap looked like a sports stadium bathroom.