Why does the engine suggest Be7 after Qe4+? [FEN "r3kb2/pp3pp1/8/2P5/1qN3p1/3Qp2r/P4P1P/5RK1 w KQkq - 0 1"]

1. Qe4+ Be7


In this position why is Be7 the best move for black after Qe4+, given that black will instantly lose its queen afterwards (Knight d6)? For example Kd8 would not immediately lose the queen (still losing the game though).
While Be7 loses the queen in three moves, Kd8 will lose the queen in the end as well. This kind of position contains a lot of forcing moves (checks, mating threats) and can be analyzed quite deeply by engines like Stockfish. They will evaluate the position at the end of their search tree, which is often >15 moves deep. For the engine, it doesn't matter if you lose your queen in one move or in 15 (though losing the queen sooner increases the chance of losing more material) - it's the end result that counts.