Why cant a king take a rook?

Why cant a king take a rook? A king can’t capture a piece that is protected. In this position the black king can’t capture the rook because the white rook is protected by the g-pawn. That’s it!

A king can’t capture a piece that is protected. In this position the black king can’t capture the rook because the white rook is protected by the g-pawn. That’s it!