Sorry for the late response! As you might have noticed, the Ditto had a Destiny Knot and when it holds that, it will get 5 of the IV stats of the Ditto, so when you breed it with a Pokemon that has no IVs, it's guaranteed to have at least 5 perfect IVs.