the Church does not define doctrine explicitly unless it is necessary to counter an heresy. Explicitly defined teachings are always based upon implicit teachings that have existed for many years or since the beginning of the Church. Petrine infallibility has been operational since it was established by Christ and exercised by Peter's early successors.
What heresy did the immaculate conception and the assumption counter?
Denial of these things. The Church had always believed that Mary committed no sins and that her body was lifted to heaven upon apparent death or sleep.