Here's a simple explanation from wikipedia:
A free-floating barrel is a specific design technology used in highly accurate rifles, particularly match grade rifles, to increase the accuracy of the weapon.
With normal rifles, the barrel rests in contact with the stock. If the stock is manufactured of wood, environmental conditions or operational use may shift alignment of the stock, which may cause the barrel to shift its alignment slightly over time as well, altering the projectile flightpath and impact point. Contact between the barrel and the stock also interferes with the natural frequency of the barrel, which can have a detrimental effect on accuracy in some cases. The interference of the stock with the barrel's forced oscillation as the bullet passes down the bore can cause the barrel to vibrate inconsistently from shot to shot, depending on the external forces acting upon the stock at the time of the shot. Micro-vibrations acting during the bullet's passage result in differences in trajectory as the bullet exits the bore, which changes the point of impact downrange.
A free-floating barrel is one in which the barrel and stock are designed to not touch at any point along the barrel's length. The barrel is attached to its receiver, which is attached to the stock, but the barrel "floats freely" without any contact with other gun parts, other than the rifle's sights. This minimizes the variance in possible mechanical pressure distortions of the barrel alignment, and allows vibration to occur at the natural frequency.
Alternatives include using a stock manufactured from composite materials which do not deform as much under temperature changes or humidity changes, or with a wood stock using a fiberglass contact area (so-called glass bedding). Stocks which contact the barrel are still popular for many utility weapons, though the most accurate have largely moved to free-floating barrels.