Suppose you attack with two infantry and four tanks against a territory defended by two infantry and a fighter.
The infantry each have an attack value of 1; the tanks each have an attack value of 3.
You roll two die for the attacking infantry; one dice for each attacking infantry. You can roll them together because if either dice comes up with a value of “1”, that die counts as a hit. So suppose you roll two die for the attacking infantry and get a “2” and a “3”, then you get no hits. Suppose you get a “1” and a “4”, then you get one hit. Suppose you get a “1” and a “1”, you get two hits.
You roll the four die for the attacking tanks; one dice for each attacking tank. You can roll them together because if any of the dice comes up with a value of “3” or less, that die counts as a hit. Suppose you get a “2”, a “3”, a “5”, and a “6” when rolling the tank attack dice. You get two hits with the tanks. If you got “4”, “4”, “5”, and “6”, you would get no hits with the tanks.
You roll the infantry and the tanks separately because if you rolled them together, you wouldn’t be able to distinguish between which dice were used for infantry attacks and which dice were used for tank attacks. Suppose you rolled all six dice together, and picked one of the dice that had a result of “2”. Would it be a hit (if it were a tank dice) or a miss (if it were an infantry dice)? No way to tell. So that’s why you roll attackers with different attack values separately.
Infantry can attack a fighter. Because Axis and Allies is a board game, certain compromises were made for playability purposes. If you had to, you could think of it like this - the attacking ground forces claim all the air stripes in a territory, and the defending air have no place left to land. Maybe the defending air used up most of their fuel in the fight, and didn’t have time to fully gas up before having to lift off to help defend the territory. Or whatever, you know.