1.Qe5! does two important things at the same time:
First of all, this move indirectly defends the white knight on d7 because if black plays 1… Rxd7, then 2.Qe8+ Rxe8 3.Rxe8# will be checkmate.
Secondly, 1… Qe5 pins the black knight to the queen on a5. Since the knight can’t move, white will capture it on the next move.
This pin is particularly effective since the black queen on a5 is undefended. This shows why you must be very careful when placing your pieces on an undefended square – they become more vulnerable to tactics.
Note that 1.Re5 would not be effective because black can then capture your knight on d7, Rxd7.