It's a harvest celebration derived from religious harvest festivals from pre-Columbian Europe with a side trip through the US Thanksgiving tradition.
There is no authoritative historical source on the genesis of the Thanksgiving Day celebration in Canada.
Anecdotally, it is sometimes linked to a feast of thanks held by explorer Martin Frobisher in the 16th century or to the tradition of The Order of Good Cheer feasts in Champlain's Colony in the 17th century; although, the connection of these events to modern Thanksgiving is probably a construction of pure hindsight.
In the territories that now make up Canada and the US, the idea of Thanksgiving Feasts as religious festivals to celebrate successful harvests or other momentous events was inherited from the old world. The Plymouth colony Thanksgiving feast of 1621 that is now considered to be "the first" Thanksgiving was in fact just one of many (and many earlier) such events observed in throughout early settlements in North America.
Harvest Feasts resembling modern Thanksgiving didn't really get going in Canada until the early 19th century and were most likely brought to the country by loyalists leaving the US during and after the revolution. These early Thanksgiving holidays started as locally or provincially defined events held on a sporadic basis on various dates and in addition to successful harvest also celebrated things like the end of the Lower Canada Rebellion.
Post-confederation, it was declared a National holiday in 1879, from thence until 1921 the date of Thanksgiving changed every year to some date in October or November but the same day as US Thanksgiving was a common choice. From 1921 until 1931, Thanksgiving and Armistice day were celebrated together in early November (and thanksgiving was basically giving thanks for the end of the Great War), in 1931, it was moved to the date it occurs on now, but it was declared by annual proclamation (and was moved one year due to a general election), and each year had a declared theme, often a bountiful harvest or a significant anniversary, then in 1957, the date was fixed by legislation that removed the necessity for annual vice-regal proclamations of National holidays.More questions on Thanksgiving: