csmath: 7. ...c5?!
is a dubious move. Bacrot has played opening well and has advantage but for some reason he got idea he will be blasting Karpov off the board. This is probably the reason why he forgot to think about the safety of his own king.
[Obviously 20. Kg2 and then Kh1 would provide white with serious attacking advantage.
Why did Bacrot decide to keep king in center?
Because he thought he can blast Karpov off the board with immediate pawn attack. Well, it won't happen.]
[this removes the last shelter where white king can hide. Bacrot is in "crazy attack" mode and it won't work. It was still not too late to think how to tuck king into h1.
Even Bacrot's wild attack could have been done better:
22. fxg6 fxg6
23. f5 Ng7
24. fxg6 Rf8
25. Ke1 Rbe8
26. Qh6! hxg6
which forces black to exchange queens and leads to ending with white pawn up. Black could hope to survive due to opposite color bishops.]
[overestimation of position, intermediate 27. gxh7 is better and leads to queen exchange and a draw.]
[This loses since both kings are now open but unlike white knight which is doing nothing black knight is ready to do major damage.]
Karpov's position after 19th move is actually very difficult and it has all the makings of a defeat. He is down a pawn, his castling will get attacked and he really has no any countergame. The only reason why he won this position is because Bacrot discounted the safety of his own king.