How is this a good move?

I missed the queens attack on took, good thing was opponent missed it too, but i saw it in next turn and moved c3, but in review the engine recommended kxd5,

Won't turn queen just take rook and even if i fork for his rook, queen has qxb1 to take my knight.

What am i missing here

I missed the queens attack on took, good thing was opponent missed it too, but i saw it in next turn and moved c3, but in review the engine recommended kxd5,

Won't turn queen just take rook and even if i fork for his rook, queen has qxb1 to take my knight.

What am i missing here