It knowing Aerial Ace lets it use the flying type Z-Move, which lets Diglett fly around in the animation, and it takes that little patch of dirt with it.