The original purpose and one current purpose was for a grip up front, thus the term "foregrip." A barrel alone is too thin to grasp or aim well. The early guns never got too hot as they took forever to load.
uhhhmmmmmmm I don't think so.
even in the era of the muzzleloaders, there were many who were able to shoot 4 times a minute, and did that for a very long time, and that will get your barrel to hot to touch in not a very long time. Another reason was for protection of the barrel, early steel barrels were often moderately soft, and dented easily in the field, adding a "cushion" of wood around the barrel helped keep damage to a minimum. I have seen several old trap doors and other larger bore muskets which have had arsenal repaired dents in the barrel. Gunsmiths made a dent roller for the damage repairs which can be found from time to time at museums and gun shows. Its a bore riding steel shaft with a slightly smaller part drilled offset and turned like a cam inside the barrel. A smith would drop the "dent roller" down the barrel and then slowly from the inside "iron" out the dent. Brownells and Briley both offer them now for better shotguns were an unfortunate accident has occured.
When you moved to the early bolt era, the wood handguards became even more necessary as you have guns that will shoot 20 to 30 rounds a minute with a competent shooter attached who is using stripper clips. Keep this up for anylength of time and then try to either grab the rifle ahead of the magazine and run with it, or grab it to use the weapon with the bayonet attached and believe me, its HOT>even thru the wood.
Another reason was to provide a comfortable place for the soldier to place his hand when carrying. Most of the early bolt action repeaters were long barreled and the only easy place to one hand carry the gun was directly infront of the action, exactly where it gets the hottest. Also non staggered box magazines made grabbing it around the action impossible.