The long ban
Canada's first Criminal Code, passed in 1892, made lotteries illegal, following the British approach of the time. There were exceptions and grey areas over the decades (church bazaars, agricultural fairs and charity raffles were often tolerated), and Canadians who wanted a bigger prize bought tickets for the Irish Sweepstakes, which were smuggled in and sold quietly for years.
The pressure to change grew in the 1960s. Provinces wanted new revenue without raising taxes, and it was obvious that plenty of Canadians were already buying lottery tickets, just not Canadian ones.
1969: the door opens
In 1969, Parliament amended the Criminal Code to allow the federal and provincial governments to run lotteries. Québec moved first. Loto-Québec was created that year, and its first game, Mini-Loto, went on sale in 1970. Other provinces followed with their own lottery corporations over the next few years, including the Western Canada Lottery Foundation and what became the Ontario Lottery Corporation.
The Olympic Lottery
The next big push came from a very Canadian problem: paying for the 1976 Summer Olympics in Montréal. To help fund the Games, the federal government launched the Olympic Lottery (Loto-Olympique) in 1973. It was a huge success, selling across the country and proving there was a national appetite for big-prize draws.
After the Olympics, the federal government kept going with Loto-Canada, which ran national lotteries in the late 1970s. The idea of Ottawa and the provinces competing for the same players wasn't popular with the provinces, though.
Ottawa steps back
In 1979, the federal government agreed to leave the lottery business to the provinces in exchange for annual payments. The deal was later written into law: a 1985 amendment to the Criminal Code gave the provinces exclusive control over lotteries and, crucially, over computer-based games and slot machines. That 1985 change is the legal foundation of every provincial casino and online gambling platform in Canada today; the Wikipedia overview of gambling in Canada is a good summary of how it all fits together.
Lotto 6/49 and the national games
To run games across the whole country, the provinces set up the Interprovincial Lottery Corporation. Its best-known product arrived in June 1982: Lotto 6/49, where players pick six numbers from 1 to 49. It became the first national Canadian lottery to let players choose their own numbers, and for decades it was the game most Canadians meant when they said "the lottery".
The odds of hitting the 6/49 jackpot are about 1 in 13,983,816, the number of possible six-number combinations from 49. Lotto Max, which replaced Super 7 in 2009, has even longer odds on its main prize, but much larger jackpots.
Lotteries today
Five regional organisations now run lotteries in Canada: the Atlantic Lottery Corporation, Loto-Québec, the Ontario Lottery and Gaming Corporation (OLG), the Western Canada Lottery Corporation and the British Columbia Lottery Corporation. They jointly offer the national games through the Interprovincial Lottery Corporation, and each sells its own regional draws and instant tickets.
Most now sell tickets online as well, through the same platforms that run provincial online casinos. Profits go to provincial governments and, depending on the province, to health care, charities, sport and community programs.
The minimum age for lottery tickets is set by each province and isn't always the same as the age for casino games. In Ontario, for instance, you can buy a lottery ticket at 18 but need to be 19 to play in a casino.