This is a contested roll and is outlined on page 82 of the CRB.
If both succeed you subtract the momentum generated from each other. If one party is left with momentum they win. In melee this means they can deal damage or use a melee combat maneuver.
If both succeed and after subtracting momentum it is a tie, the active party (attacker) wins.
If both fail, the defending party wins but doesn’t get a benefit. (They successfully dodged but does not counter attack)