How election dynamics shape perceptions of electoral integrity