What advantage does black gain from this move? Consider the following:

[FEN "r3q1k1/p2p1p1p/b1p2QpB/8/8/2r5/P4PPP/R5K1 b - - 0 1"]


Why is black's next move Qf8? White just follows with Bf8.
There is no good way to stop Qg7 mate. Black has to give up their queen.