
Handguard

A handguard (also known as the forend or forearm) on firearms is a barrel shroud specifically designed to allow the user to grip the front of the gun. It provides a safe heat-insulated surface for the user's hand to firmly hold onto without needing to worry about getting burned by the barrel, which may become very hot when firing. It can also serve as an attachment platform for secondary weapons (such as an underslung M203 grenade launcher or M26-MASS) as well as accessories such as bipods, tactical lights, laser sights, night-vision devices, foregrips/handstops, slings and a variety of other attachments. 
Handguards are available in 2 different variations: free-floating and drop-in. They also use a number of mounting systems with the main ones being M-LOK, KeyMod, and Picatinny.
When talking about melee weapons, a "handguard" refers to the crossguard (also known as the quillons or crosstree), the enlarged front part of a sword, saber or knife/dagger's hilt, which protects the wielder's hands from an opponent's blade sliding towards the hilt, or prevents the wielder's own hand and fingers from accidentally slipping onto the blade when stabbing.
Free-floating Handguard.
Free-floating handguards, also referred to as "floating" handguards, have seen a rise in popularity in the recent years. They work by only attaching to the firearm at one point (on the barrel nut by the upper receiver) while the remainder of the handguard does not make contact with the barrel. This gives the impression that the handguard is "floating" around the barrel, hence the name. 
Free-floating handguards have been known to increase accuracy between 0.5-0.75 MOA (0.15-0.2 mrad) compared to their drop-in counterparts. The reason for this increase in accuracy is due to the avoidance of an issue known as barrel warping. 
Barrel warping occurs when the handguard makes contact with the barrel which then slightly alters the barrel's angle reducing accuracy. An instance where this would occur would be when a rifle is propped up against a surface during or when a bipod is used. Force exerted onto the handguard pushes back up against the barrel which in turn changes the barrel's angle reducing accuracy. The angle may seem insignificant, however, even a slight deviation can be magnified causing the shot to be widely off down range. 
Free float handguards do not suffer from barrel warping due to the fact that the handguard floats around but does not make contact with the barrel. Force exerted onto the handguard is not pushed back onto the barrel which allows for an increase in accuracy.
References.
KeyMod vs. M-LOK Modular Rail System Comparison, Presented by Caleb McGee, Naval Special Warfare Center Crane Division, 4 May 2017