Endgame analysis

Sort:
Avatar of fromzeroto2000
Black to move in position above. Why does white win?
 
From a recent rapid game. In the game there was a black pawn on g3 with white king on h3, and I swapped the rooks which is a draw, as there was only 20seconds on the clock.
 
But tablebase shows that if I had taken pawn with king (which gives the position above), it was winning for me. I don't understand how and am wondering how you determine this quickly in a game.
 
Thanks for the help!