We throw each candidate into a tank and fill it up with flags.
First person to moderate their way out (and not drown) wins.
In primaries the first-nominated in a tie goes through.
In the main election, it's a different system as Jez commented. We use Meek STV which is a very complicated (by very fair) single-vote, multi-preference system. You can look it up if you like... The side effect of this is in an organic situation, you're extremely unlikely to end up with exact ties.
That said, if one did happen, Stack Exchange would just add another seat and we'd have an extra moderator. This is contrary to the standard OpenSTV behaviour which just picks a random winner (that I was previously suggesting).
I've asked for what would happen if there was a massive tie (too many to add seats) but I think at some point things are either going to get random or violent.