The tradition of counting from the creation of the world (anno mundi, or AM, vs. anno domini, or AD) comes from various texts of the Middle Ages. Counting from the creation of the world was common through the eighteenth century in many general histories as well, though the Enlightenment tradition critiqued such historical views (such as AM and organizing the history of the world into the four kingdoms of Daniel) as antiquated and unhelpful. This is tied to a broader reconceptualization of the landscape of history with the rise of the concept of the century.
This trend can be seen, for example, in texts such as the Sefer Ha-Qabbalah (Ibn Daud), who wanted to show the long and unbroken chain of the Jewish tradition. Thus, the counting of years from the creation of the world is inherently part of religious polemics.
First, against the Karaites, Ibn Daud wanted to demonstrate that the Jewish oral tradition (the Talmud) came from Moses.
Second, against the Christians, Jews in Europe (not ibn Daud) wanted to demonstrate that a Christian proof for the divinity of Jesus -- a messianic calculation, that the date of Jesus' birth was in the year 6,000 AM, similar to the many Jewish predictions of the messiah -- was incorrect because the Christians had calculated the calendar incorrectly.