Mary has since the very beginning been called "the mother of the Lord" (Luke 1:43) and "the favored one"/"endued with grace" (Luke 1:28), and the early Church understood that she had a special role in the history of salvation, being called "the God-bearer" (Theotokos), "the mother of God" and "the all-holy" (Panagia). Throughout the ages, the Church more and more understood who she was, in many ways it reached its height in the 1850's when the centuries-old belief of the Immaculate Conception was made dogma.
The standard Catholic apologetic answer is to compare the development of doctrine to a seed. The seed grows into a tree, which looks different, but it's still the same object, just in a more another form. The Apostles believed in the Incarnation and the Trinity. But the Church would still need several Ecumenical Councils over the span of centuries to fully explain these doctrines. The Church has always believed that Mary was a special person with a special mission, that she was the mother of God, she was holy, she was the Kecharitōménē ("the favored one").
Irenaeus, the "spiritual grandson" of St. John the Evangelist (he was a disciple of Polycarp, who in turn was a disciple of St. John), set up Eve and Mary as type and antitype, laying the foundation for calling Mary "the new Eve". The oldest prayer to Mary that we have today, the "Sub tuum praesidium", might predate the Council of Nicea. Those are some early examples.
So the particular Marian doctrines and devotions developed over time, and in stages. But they did not appear out of thin air, and neither was their development seen as unnatural or contrary to devotion to Christ our God. The "Marian seed", so to speak, was always there.