In the evaluation of the hands, there's 3 things that are checked (out of the best 5 cards out of the 7).
1) Type of Hand (4-of-a-kind, Full House, Flush, ect.)
2) Highest Card in hand set
3) 2nd Highest Card in hand (regardless of set)
If the tie isn't broken after all 3 checks are done, a split pot is declared.
In your scenario...
1) Both Players (A & B) have the same type of hand: 1 Pair
2) For Highest Card in-set (the Pair): Player A has Jacks, Player B has Kings
Therefore, Player B wins the hand.