That little gadget is called a "widget," and you should be thankful for it. It's making your beer taste like it was just poured fresh from the tap.
A widget is a hollow, spherical piece of plastic with a tiny hole in it - it looks like a little ping pong ball.
During the canning process, brewers add pressurized nitrogen to the brew, which trickles into the hole along with a little bit of beer. The entire can is then pressurized.
When you open the can, the pressure inside the can drops to equalize with the pressure in the room. Since the pressure inside the widget is still much higher than the pressure in the beer around it, the nitrogenated beer from inside the widget squirts into the beer - providing a burst of tiny bubbles of nitrogen gas that rise to the top of beer, giving it a thick, creamy head you'd get straight from the tap.
Guinness brewers first patented the idea of the widget in 1969, but it wasn't until 20 years later in 1989 when they released their first-generation widget, which was a flattened sphere that sat at the bottom of the can. This little piece of plastic did its job well when serving the beer cold, but when served warm, the beer exploded everywhere after the can was cracked open.
Breweries typically use carbon dioxide to give a beer its quintessential bitter fizz, but when a drink calls for a sweeter, silkier experience - such as the experience you get when drinking a Guinness - brewers infuse the ale with nitrogen rather than with carbon dioxide. Nitrogen bubbles are smaller than CO2 bubbles, so the resulting head and taste is smoother and more delicate.
Nitrogen gas also doesn't easily dissolve in water, so when you crack open a beer, most of the gas is released into the air but the foamy bubbles in the head still remain. This - along with the smaller bubbles - gives the brew a thicker, more velvety "mouthfeel" without the acidic bite of carbonation with CO2.
Because of the fleeting nature of nitrogen gas in liquid, it's really hard to maintain tasty levels of the gas in packaged beers once you open them.
"With nitrogen, you would require way higher (and dangerous) levels of pressure, and still loose plenty of nitrogen (and beer due to foaming) during packaging," Xavier Jirau, scientific advisor of the homebrew club The Brewminaries, told Tech Insider via email. "In order to deal with this issue, brewers got little creative, and there is where Guinness plastic widgets come into play."
The popularity of widgets have caught on since Guinness introduced them in the late 80s. Other beers such as Old Speckled Hen, Young's Double Chocolate Stout, Murphy's Stout, and Boddingtons Pub Ale all have widgets in their cans.
So go crack a cold one and thank that little plastic sphere for delivering your delicious, velvety brew.