Two months ago, Joe Ganim received the most votes in the race for mayor of Bridgeport, Conn. This week, the city will vote again — to decide if he should even be the Democratic candidate.

The unlikely and confusing situation arose after a judge ruled that there was enough evidence of misconduct in the Democratic primary in September to throw its result — a victory by Mayor Ganim — into doubt. The judge pointed to videos showing “partisans” repeatedly stuffing absentee ballots into drop boxes.

The footage provided a particularly lurid illustration of ballot tampering, though experts say election fraud is rare in the United States and often accidental when it occurs.

But in Bridgeport, Connecticut’s largest city, ballot manipulation has undermined elections for years.

In interviews and in court testimony, residents of the city’s low-income housing complexes described people sweeping through their apartment buildings, often pressuring them to apply for absentee ballots they were not legally entitled to.

Sometimes, residents say, campaigners fill out the applications or return the ballots for them — all of which is illegal.