“Thanksgiving” is a harvest festival, and has its roots going back to perhaps the time agriculture was first adopted by early tribes and probably preliterate times.
Much of”harvest festivals involved presentation of gifts to deities as a sacrifice and in thanks for a bountiful crop yield. The religious connotations cannot be denied, and probably the biggest portion of these earlier harvest festivals was devoted to the giving of thanks to whatever deity was involved.
This kind of celebration was widely held around the world long before the Pilgrims came to what is now America, and the themes are surprisingly similar across cultures.
The Pilgrims did not invent “Thanksgiving” but merely adopted an old custom that already existed. Perhaps by now it has been raised to an art form, but the spirit of Thanksgiving was part of the human psyche rooted in the very dim past.
Actually it was based on Sukkot which is one of the seven feasts of the Lord in the Torah.
The Puritans were serious students of the Old Testament; at one time they seriously considered making Hebrew their official language.