Approximately 12,000 years ago, the First Men made their way to Westeros from Easteros and crossed paths with the Children of the Forest. The First Men are regarded as the first humans to ever step foot on Westeros.
When the First Men arrived, they began burning down the forests and trees. This provoked war between the First Men and the Children of the Forest. The war was being won by the First Men, as they were larger and possessed more advanced weapons. In an attempt to prevent additional men from migrating from Easteros to Westeros, the Children of Forest used magic to destroy the Arm of Dorne, a landmass that connected the continents and allowed for passage between the two. Today, because this landmass no longer exists, you now must sail across the Narrow Sea to get from one continent to the other. Despite the efforts of the Children, the First Men continued to win the war.
However, after nearly 2,000 years of war, the two sides signed the Pact. The First Men agreed to no longer burn down the forest lands and let the Children of the Forest keep these lands which were holy to them. The Children of the Forest agreed to let the First Men have all other open lands. They began to live together in harmony and the First Men began to adapt the religion of the Children, the Old Gods, as well as their culture, language and general way of life. They lived in peace together for 4,000 years. The First Men are the ancestors of the Starks and most other Northerners. This explains why, today, the Starks and the Northerners still pray to the Old Gods whereas the rest of the Seven Kingdoms prey to the Faith of the Seven.