Bartenders in Argentina sometimes entertain patrons by tossing a few peanuts into their beer. Initially, the peanuts sink, but after a few seconds they rise, wreathed in bubbles. Once on the surface, they roll, causing the bubbles to pop, and the peanut sinks once again. The cycle repeats, sometimes for as long as a couple hours.
There are a couple physical processes governing this dance. The first is bubble nucleation. Most beers are carbonated; they contain dissolved carbon dioxide gas that remains in solution while the beer is under pressure. Once poured, that storage pressure is gone and bubbles start to form in the liquid. The shape of the peanut means that bubbles form more easily on it than on the glass walls or in the liquid. And once the peanut is covered in bubbles, buoyancy comes into play. The bubbles attached to the peanut reduce its density relative to the surrounding fluid, enabling the peanut to rise up and float.
This same process is seen with other objects in carbonated fluids, too, such as blueberries in beer and lemon seeds in carbonated water. But it’s also reflected elsewhere in nature. For example, magnetite crystals are thought to float in magma due to a similar nucleation of dissolved gases on their surface. (Image and research credit: L. Pereira et al.; via APS Physics)