Two Pair: When the pot splits and when the kicker determines a winner?

I had the following back to back hands and in one a split happened and in the other each player’s kicker played a part on who won the pot, but the hands look/played out the same to me, so I was hoping someone could enlighten me please and thanks in advance.

Dealer: Dealt to board: [ Ac 9c 9d ]
Dealer: Dealt to board: [ 7s ]
Dealer: Dealt to board: [ 6c ]
Dealer: Showdown: Main pot, 2,750 chips
Dealer: bry4n23 shows [ Ad 3s ]
Dealer: readyplayer0 shows [ 6h Ah ]
Dealer: bry4n23 wins 1,375 chips with: Two Pair, Aces and Nines
Dealer: readyplayer0 wins 1,375 chips with: Two Pair, Aces and Nines
Dealer: ** Hand [ 1063624808 ] started **
Dealer: Zaylee shows [ Js Ad ]
Dealer: readyplayer0 shows [ Td Ah ]
Dealer: Dealt to board: [ Kc Kd 8s ]
Dealer: Dealt to board: [ 6s ]
Dealer: Dealt to board: [ Ac ]
Dealer: Showdown: Main pot, 3,600 chips
Dealer: Zaylee wins 3,600 chips with: Two Pair, Aces and Kings

In the first hand, both players have a 7 kicker - from the board, neither the 3 or 6 plays. In the second hand, both the J and T play, but the J is higher and wins.

@readyplayer0 Yes, @lihiue is right.

Poker hands are your five best cards

The first hand is A-A-9-9-7 vs A-A-9-9-7. The 6 on the board and the 6 or the 3 in the hands dont play

The second hand is A-A-K-K-J vs A-A-K-K-T. The kickers in the hole cards do play because they beat the 8 and 6 on board.