Why would Black play this?

I was playing computer and it played this move and I mated in 2. But for life of me I can't figure out why it would move the defender. Is there actually any tactic I am missing?

image
Read also:

might not be very impressive, but I found my first forced mate in more than two moves

image

might not be very impressive, but I found my first forced mate in more than two moves

image

How does this qualify as "brilliant"??

I am not a chess beginner, but I do have many questions

image

How?

How is it even possible to deliver a checkmate with a king?

image

My dad asked me to teach him about chess, and this happened in our first game

I started without a queen to balance the odds for anyone wondering

image

Am really proud of myself for finding this checkmate

image

Why did the game not end..... WHY DID IT NOT END 😭

0dfb790c86eedaf360b33.jpg

When you can’t find your chess board but find two sets of scrabble

0dfb790c86eedaf360b33.jpg

How is this a good move. Best moves shayd that he wouldn't take but why not

image

My first game with 0 mistakes This one was my biggest inaccuracy

image