Your water params were probably not as bad as you believe. As long as your Ca, Alk, and Mg levels were OK, and you had sufficient lighting on the tank, it would grow.
Sometimes the rock that we get at the LFS has been recycled from other peoples tanks that have been broken down. Or, has been used to display corals for sale. All it would take is a tiny little piece of the coral to be present on the rock, and over time, can sprout up, seemingly from nowhere.
Monti cap is one of the easiest SPS to care for, and it obviously likes where it is, so keep it up!
That's one of the best hitchikers I've ever seen anybody get. That piece, as it is right now, would be about $30 at a typical LFS. Good score!!