Because the aim is to make a five-card poker hand, whoever has the highest fifth card in this case wins. If the board reads 77773 and you have AQ in your hand and your opponent has KQ, then you win because you hand is 7-7-7-7-A and your opponent's is 7-7-7-7-K. You would also win even if your opponent holding was KK in this example.