The British North America Act was what originally set up the electoral law of Canada based on "a constitution similar in principle to that of the United Kingdom" (Preamble). For background on how elections and the other features of the Westminister Parliamentary system were designed see the original document (with amendments to 1886).
The current Election Act (last amended in January 2016) is the law that governs all aspects of federal elections in Canada. In addition to this act all provinces have their own election laws that govern elections at the provincial / territorial and municipal levels.