Funny story from last night: the Conservative leader’s own riding had the longest ballot in Canadian history — 90 candidates! Even though it was one of the earlier ridings to close, the results weren’t confirmed until this morning. I’m guessing the sheer size of the ballot had something to do with the delay.
You start with empty ballots and the electoral list. You record every ballot that's used (or damaged) and every voter that shows up and casts a vote. You end up with a paper trail of everything that happened as well as every ballot.
Every bit of the process is done by two employees+a polling station supervisor+party representatives (volunteers) making sure everything is done by the book. Everything should balance if there hasn't been fraud or mistakes. Counted ballots go in respective envelopes (for box 57 you'll have a liberal party, conservative party, green party, npd, invalid ballot, etc. envelop) allowing for swift recounting and making sure valid ballots for the right party are in every envelop.