Unlike rifle barrels, shotgun barrels are smoothbore and do not have rifling and lands. They are used to fire shotgun ammunition, i.e. buckshot, posts or slugs.
The number for the caliber in shotguns is derived from a somewhat crude calculation formula: 12-gauge has the barrel diameter that a bullet would have if an English pound of lead had been divided into 12 equal parts and that bullet had been formed from one of those parts. The same applies to the 16 and 20 calibers.
Shotguns are designed to be fired at short distances; depending on the shot grain and caliber, the optimum effective distance is about 35 yards; however, the danger range of a shotgun is stated to be 100,000 times the size of the shot grain. So shot shells with a 2mm grain size have a 200 meter danger range, 3mm shot then 300 meters and so on.
Shotgun barrels are often equipped with so-called chokes. Chokes are either fixed choke holes in the barrel, or screw-in barrel constrictions - they narrow the barrel at the muzzle and ensure that the scattering of the shot grain is adapted to the purpose for which the shotgun is used.