A question about a puzzle It's White to move. Why does Stockfish evaluate 13. Kh1 so much higher than 13. Rf2? They both seem like reasonable options for me, yet the former is evaluated +7.95 for white and the latter is at -0.45. For some reason after 13. Rf2, Stockfish considers castling the best option for Black but doesn't castle after 13. Kh1.
[FEN &quot;r1b1k2r/pp1n1Np1/2pbp2p/3p4/3P4/P1NBq1P1/1PP3PP/R2Q1RK1 w kq - 0 1&quot;]
At first glance, before concrete calculation:

1 Kh1 looks reasonably safe, the king is out of harms way for good.
1 Rf2 self-pins the rook and disjoints White's whole army with no obvious upside. Why play it over 1 Kh1?

Looking a bit further, Black's queen is almost out of escape squares. However, the Rf1 is the only piece that can reasonably seal the trap by attacking e3 (d4 needs to be covered too, of course). Doesn't work if its pinned!

1 ...0-0 indeed looks like a good move after 1 Rf2: not only gets the Rh8 out of the attack of the Nf7, but in turn also attacks the Nf7 twice, while it is now completely undefended due to the pin. Worse, the Rf2 is also under pressure, White can't just retreat his knight and open the f-file, or ...Qxf2+.
1 ...0-0 doesn't quite work after 1 Kh1 on the other hand because now the rook is not pinned and White can simply play 2 Rf3. After 2 Qxd4, castling enabled the discovered attack 3 Bh7+!, which wins the queen for a bishop.
The same tactic would in theory work after 1 Rf2 0-0, too, except that in that case, White could not force Black to take on d4. A weakness is only a weakness if it can be exploited.
If Black does not answer 1 Kh1 by castling, they will soon lose material either way (queen is trapped, rook hanging, etc.).