the small plastic ball is called a widget. The purpose of the widget is to release CO2 from some of the beer in the can to create the head. It is meant to mimic the texture and head of Guinness on tap.
sounds like it was your 1st drinking Guinness from a can.