First, the value of the main combination is compared (for example, the rank of the three-of-a-kind, or the higher pair in two pair), and if that ties, the remaining cards ("kickers") are compared in descending order. If every relevant rank is identical between two hands, it's a tie (split pot).