Best play - black loses in a few moves. By playing Bg7, you lose the queen (Rxd7). Then no matter what you play, white Plays (EDITED)Qb7#. Mate in 2.
Moving the queen anywhere still loses, but avoids mate by a couple of extra moves. Mate in 4 is better than Mate in 2, as such Qd4 is (Best), It was just one of the available random squares the queen could be moved to, that the computer had to choose from with a similar result.
I was playing against a PC and somehow it said this is the best move for Black. Can anyone essplain?