What does White threaten? His queen attacks Black’s queen, which in turn is protected by its king. The prospect of winning the queen justifies not only a check but a check sacrifice by White: he plays Re7+, sticking his rook flush against Black’s king. Black plays KxR; but in capturing White’s rook, Black leaves his queen loose and loses it to QxQ+. (The position is essentially symmetrical; if it were Black’s turn to move, he would win using the same method.)
Incidentally, you might think that if Black’s king declines to capture the White rook and instead moves out of its way (say, to d6), Black’s queen is then lost to RxQ—a skewer. But the result is worse than that: White plays QxQ+ and mates a move later (Black’s king is forced to c6; then Rc7 mates). The result is similar if Black moves his king to f6: 2. QxQ+, Kg6 (forced); 3. Rg7+, Kh5; 4. Qxg5#. Consider this a reminder not to forget that chances to mate may arise unexpectedly and mustn't be overlooked.
These first two positions have notable points in common. Both involve an enemy king and queen adjacent to one another with the former protecting the latter; both involve an attack by your queen on the enemy queen; both involve the sacrifice of a rook by sticking it next to the enemy king, forcing the king to capture and thus drawing it away from the queen—a decoy. These features constitute a common pattern that we will see in various forms several more times.