Back at the dawn of fighter planes, it was believed that the wings had to be thin in order for the plane to be able to fly. So, when someone decided to add a machine gun to a biplane and create the first fighter plane..there simply wasn't enough room in the wings to put a gun. So, the guns were mounted at the center of the upper wing..on top of the wing. Later, when the interrupter gear was invented, the gun or guns were moved to the nose of the aircraft..making it easier to bring the stream of lead to bear on the target aircraft.
It was the Germans, I do believe, who discovered that the wing could be made thicker and the plane would still fly...as long as the airfoil shape was maintained. Once airplane wings were made thicker....there was room for guns to be installed in the wings. However...there were still a number of aircraft built after this that had guns in the nose. The Zero, the early P-40s. Heck even one of the early Mustang variants, the A-36 Apache dive bomber, had guns in the nose.
OBIO