White’s queen is under attack by Black’s queen and has no protection. The question is what White should do about it. Any checks you can give with your queen have to be examined in any event, and here White can administer check on the long diagonal with 1. Qe4. You further see that the Black king is terribly constrained: the rook on a8 cuts off the entire eighth rank, so it has no flight squares; it's as if the king were stuck in the corner of the board. This means that in reply to Qe4 Black will have to interpose his queen at g6 to block the check. An interposed piece is a pinned piece. Think about how to capture it. The difficulty, common enough when a pin arises this way, is that the king itself guards its queen. The natural answer is another check to drive the king away. White has a resource for the purpose in his rook. He plays 2. Ra7+. If Black moves his king to g8, White has 3. QxQ+ and then uses the queen to mate on the seventh rank a move later. If Black’s king instead goes to h8, White still can play QxQ (not a check) and then mate soon, after Black exhausts a futile check or two at the other end of the board. Or, better, White can go with 3. Qxe5+ (holding the initiative), Qf6; 4. QxQ+, Kg8; 5. Qg7#.
Notice that Black also can start by interposing his knight at f5 rather than using his queen; but then White just renews the check with QxN and this time Black is left with no alternative to Qg6. The two queens then are faced off on adjacent squares, but it makes no difference. White still plays Ra7 and play proceeds as explained.
One final thing: On White’s second move it might naturally have occurred to you to play the rook check Rh8 rather than Ra7. This still wins a queen for a rook, but it has to be considered a blunder since it blows the chance for mate. When you need to give a check, be sure to consider whether there is more than one way to do it.