A former Marine Harrier pilot explains the difference between firing at other airplanes and shooting at targets on the ground:
There aren’t many things more fun than strafing targets on the ground, and for tactical jet pilots, there are few activities more dangerous (or in the case of a F-22 Raptor, more stupid). The 20mm six-barreled Gatling gun on the F-22 is mounted for an air-to-air knife fight (inside a half mile). The M61A2 features high rates of fire and a tremendous muzzle velocity, but there are only 480 rounds of ammunition, just over four one-second bursts). This ammunition was not designed for ground targets, it was specially designed to blow up other aircraft. The Raptor also lacks the armor and the price tag required for fecklessly dueling Grunts who own automatic weapons and hate pilots who make more money and look better than they do.
What most non-tactical jet pilots don’t know is that air-to-air and air-to-ground cannon are mounted differently. An aircraft with an air-to-mud cannon is at a gunsight depression disadvantage in a dogfight, and the opposite is true for fighter pilots who wish they were heroic attack pilots. Consider for a moment. If your primary mission is to make earthmen miserable, the axis of your cannon will be depressed from the longitudinal axis (fuselage) of your aircraft. This allows pilots to enjoy a more shallow dive and therefore leisurely opportunities to perforate the rabble and break their toys. Fighter pilots, conversely, have cannon that are biased above the longitudinal axis, because most of our enemies don’t like to get shot and are pulling as many G’s as they can to keep from getting their jump wings. If your gun is pointing up a few degrees, you don’t have to pull your nose all the way to the bogey’s jet before your glowing “death dot” is resting on the back of his helmet. This also means that F-16 and F-22 pilots have to strafe in a steeper dive and shoot quicker to keep from suffering cement poisoning.
Even if there aren’t any inconvenient Grunts with automatic weapons and shoulder-fired missiles in the target area, strafing is flat dangerous. In a shallow dive at 550 knots, Harrier pilots need to take a 5-G divergent “jink” (left or right) from the delivery azimuth after a one-second burst to prevent a fateful rendezvous with their own depleted uranium ricochets. And it’s worse when your targets are exploding (not least because it is tempting to admire one’s work). Certainly strafing is viable with a purpose-built system like the A-10, which was optimized for this kind of fun (and couldn’t catch-up with its own bullets on its best day). The application of an F-22 20mm cannon against ground targets isn’t going to do much beyond getting some Raptor pilot 20 percent closer to enemy ace status.