When two players have the same hand rank, such as a pair or a flush, the winner is determined by the highest-ranked card(s) in their respective hands. If the highest-ranked cards are the same, the next highest-ranked card(s) are compared until a winner is determined.