In terms of the real world / operational differences of LMG vs. HMG
The main difference most often cited by aircrews and responded to by designers was
effective range. The .30 cal weapons were very generally speaking considered relatively ineffective at more than 200 meters. How much this mattered depended in part on the number of guns and the nature of the guns - the Soviets for example had very fast firing 7.62mm LMGs which could cause a lot of damage, but as a rule they tried to get within 50-100 meters before opening fire anyway. The British famously put 8 x .303 guns on their fighters (later 12 guns on some) to concentrate firepower, so if they were in range they would likely kill their target quickly.
The .30 cal guns tend to spread out in a wider cone though which is part of the reason for the shorter effective range. Greater range meant fewer hits.
Americans were taught to do deflection shooting though only a few could master the skill - often guys who had a past history of hunting or some other kind of marksmanship. Most US fighters lacked nose guns and wing guns were not as accurate. One method they were trained to use was to use their wing mounted HMGs to shoot streams of bullets with tracers they could walk into their targets. Each pilot would work with their armorers accordingly to set range conversion of their guns based on their own preferences and marskmanship skill. There were a number of different options: all guns converging at 200, 250, 300 or 350 yards, or to have a pair of guns converging at three different ranges - one pair at 250, one at 300 and one at 350 for example, or a pair at longer range like 400 yards and the other four at 300.
But effective range for .50 cals was up to 500 yards or more, albeit with increasing challenges to accuracy. During a long stern chase range cold be almost double that. In one incident in North Africa for example an American P-40F shot down a Spit VC in a case of mistaken identity after a long chase, reportedly at a distance of 800+ meters (too far to identify what they were chasing). On another occasion J.G. 27 experten Hans Stahlschmidt
was shot down from below at extreme range by Clive Caldwell. Caldwell himself said the distance was 700 yards, fellow
experten Hans Joachim Marseille and Hauptman Homuth who were on the flight with Stahlschmidt both commented on the range of the hit.
The API .50 cal ammunition used by the Americans was initially just intended to mark the target - the little flash of a small amount of incendiary charge was an indication to the pilot that they had gotten a hit. The fact that this flash could ignite fuel, hydraulic fluid, oil and so on was an appreciated additional effect. Tracers had a similar purpose obviously but some pilots preferred not to use them because enemy fighters could avoid the bullet stream with a quick jink or slip when they saw the tracers coming.
.30 cal weapons were typically considered a problem vis a vis defensive fire from bombers - both for the bombers themselves and for fighters attacking them. One of the complaints I've read about the early LMG based armament of Spitfires and Hurricanes was that it put them within the range of defensive bomber gunners. This was worse if the bomber had HMG or cannon armament in their defensive panoply - like the G4M "Betty" (20mm tail gun) the later He 111 (13mm in dorsal or rear gun position), or the SM 79 in the Med (1 or 2 defensive 12.7mm MG in dorsal or ventral positions). And of course most of the US made multi-engined bombers had .50 cal defensive guns, and this was a big problem particularly for the lightly armed Ki-43.
Defensive armament consisting of .30 cals, .303, 7.9mm etc. was often considered insufficient due to having about half the effective range of the heavier guns, and was routinely increased to use HMG or cannon defensive guns where possible. HMGs could outrange LMGs particularly during a long stern chase approach. Most cannon could as well. Conversely fighters were up-gunned so as to outrange defensive gunners and to quickly take them out, especially if they were protected by armor.
The second biggest issue was
armor and protected fuel tanks. Early war military aircraft typically lacked any kind of protection, it was gradually brought in during 1939-41, especially during the Battle of Britain. Early armor was however often quite light, average probably about 8mm of unhardened steel. Sufficient to stop most .30 cals but not HMGs or cannon with AP ammunition. Also after armor was adopted, many other systems such as fuel lines, hydraulic lines, control cables and others were vulnerable to a stray bullet. It took a while for redundancy to be built in so as to decrease vulnerability. They also started putting in thicker armor of up to 12-15mm, and then later tempered / heat treated plates which could be just as strong for half the weight (so a 6mm plate was equivalent to a 12 or 13mm plate).
Aside from range, another factor which could make a big difference was angle of attack. This was true for all types of guns but it made LMGs potentially much more lethal. With Zeros they had an infamous trick where, when pursued from behind they would suddenly jump up into a loop that their pursuer could not follow, then come down onto their attacker from behind and above, and shoot right into the cockpit. This was more lethal with the 7.7mm guns concentrated in the nose of both A6M and Ki-43. Shooting from above in this manner allowed the attacker to bypass the armor and kill pilots or puncture fuel tanks. This kind of high angle attack was also incidentally done by Hans Joachim Marseille when attacking Allied fighters flying in defensive Lufberry circles over North Africa. The plexiglass cover on most aircraft offered zero protection to the pilot. Spitfires and Hurricanes also had fuel tanks in front of the cockpit.
Another method used frequently by the Japanese (and by everyone, really) was to spot an aircraft with an oblivious pilot flying straight and level, dive below it and come up from underneath, shooting into the belly from close range. This was a good way to kill the pilot as above but also to shoot holes in the coolant systems of in-line engined aircraft or damage the oil coolers and so on. Again, from close range, at the oblique angle, an accurately aimed LMG could easily kill almost any Allied fighter.
Finally, one can always find anecdotes where the 20mm cannon shells did not bring down the fighter. There was a great deal of luck involved but also how much time the attacker had to score hits, and how close of a pattern they managed.
Here is one I've posted before, Clive Caldwell posing with his Tomahawk after a tense fight with JG. 27 experten Major
Werner Schröer and his wingman. Caldwell managed to shoot down the wingman and damage
Schröers fighter enough to escape, though he was wounded in the back, shoulder and leg (probably with shell fragments). You can see what look like at least three cannon hits in the right wing.
This one is a US pilot of the 79th Fighter Group examining a 20mm shell hole, one of about 8 that hit his P-40 from a Bf 109. Obviously his behind the seat armor plate saved him.
A crash-landed P-40K of the 57th FG, also in North Africa with 20mm cannon holes near the cockpit. The pilot survived with minor injuries.
A Bf 110 damaged (IIRC) by Spitfires, gives you an idea how the cannon could tear apart an aircraft. One or two more hits on that tail structure and it would have come off.
And for comparison, an He 111 damaged by a hail of .303 bullets (I think) in the BoB