This position illustrates a very useful principle. White has a queen aimed at h7. If the queen had cover from another White piece aimed at the same square, the result would be a mating threat. A classic way to so aim a second piece is by putting a bishop behind the queen, as with 1. Bd3. There is then a standard way for Black to address such a threat: he moves his g-pawn forward to g6, interrupting the queen’s path (and, in this case, threatening it to boot). But the point of the mate threat wasn’t to mate. It was to force this disruption of the pawn cover in front of Black’s king. When pawns step forward as Black’s g-pawn does here, lines to the king often are opened that can then be used for other tactical purposes—such as forks. In this case notice that Black has a loose bishop on d6; after the little sequence just sketched White takes the bishop with 2. Qf6+, Rg7 (interposing to block the check); 3. QxB.
The pattern here is important to master: lining up pieces against the enemy king’s position so he is forced to move his pawns forward, then exploiting the line he has opened with a fork or other tactic.