Strange things can happen in elections. Some of that strangeness arises from factors related to candidates, cranky voting machines, skewed opinion polls, downright fraud, and other human and electromechanical foibles. Some of it comes out of inevitable quirks in election procedures, especially when more than two candidates are involved.
Suppose there are three candidates, Heather, Angela, and Kathy, and the election procedure calls for ranking the candidates in order of preference. The voters understand this to mean listing their top preference first, their middle preference second, and their bottom preference third.
Three voters put Heather first, Angela second, and Kathy third. Three voters have Kathy first, Angela second, and Heather third. Four voters have Heather first, Kathy second, and Angela third. Four voters have Angela first, Kathy second, and Heather third. When the votes are tallied, Heather is the top choice for seven voters, Angela is top for four voters,