Normally when breeding the baby only inherits 3 of the parents ivs, but if one of the parents is holding a destiny knot, that number is increased to 5 ivs. So if you're breeding 2 perfect pokemon, you're guranteed 5 perfect ivs with destiny knot, the last iv is up to chance