A machine gun is a firearm designed to fire bullets as long as the trigger is held, as opposed to semi-automatic weapons that require a trigger-pull for each bullet. The first truly automatic machine gun, the water-cooled Maxim, saw action in WWI, helping make that conflict the high-casualty nightmare it would become.
A Heavy Machine Gun in history is usually a machine that fires larger caliber rounds than a standard MG. HMGs were not portable devices and were often only mounted in defensive emplacements, tanks, and rarely on aircraft.
"The Browning M1917 heavy machine gun saw action in the American military for about 40 years, starting in 1917 and continuing past the Korean War. It was recoil-operated, meaning that recoil generated by each round pushed back the firing mechanism and primed the weapon to fire again. Three-man crews were assigned to each M1917, which each one trained to do his job even in total darkness; they could also cover each other's roles if needed. Despite its reliability, it was replaced by the far smaller and lighter M60 in 1957".