White’s b2 bishop is loose and is attacked by Black’s knight, and meanwhile Black is ahead on material. As White, what do you have as the basis for a counteroffensive? That dark-squared bishop is on the long diagonal, and your rook is on the half-open g-file (i.e., there are no White pawns in its way). The g7 pawn thus becomes the focus of your attention. Importantly, you also have another rook on a1 that can get over to the g-file in one stroke. This makes a sacrifice to clear the g7 pawn out of the way plausible, because afterwards you will have a heavy piece ready to finish the job. White therefore begins by imagining Rxg7+ and sees the beginnings of Morphy’s mate: Black will have to move his king to h8, and then if White draws his rook back up the g-file he will discover check.
But wait: that’s not quite going to get it done here for two reasons. The first is that the piece doing the checking—the b2 bishop—will get captured right away by Black’s knight. Secondly, Black could interpose on the diagonal. The problem isn't f7-f6; if that were the only issue, White could deal with it by playing 2. Rxf7 as we recently saw. The problem, rather, is that Black can interpose with d5-d4 (the pawn is protected) or for that matter Ne5. So White thinks about methods for dealing with these sorts of difficulties and finds that after Black’s Kh8 he can play Rg8++—checking the king twice and allowing Black no alternative but KxR. Now White rolls his other rook to g1 and it’s checkmate. (Black can interpose his queen at g5, but White just takes it with RxQ#.) Since the crucial check is being given down the g-file, those interpositions on the long diagonal don’t help Black.