I suppose if either of the parents holds a destiny knot,5ivs are chosen randomly from either of the parents while 1 is chosen randomly....
Without a destiny knot one can get random 3 ivs from a parent while 3 are chosen randomly.
For example:
A mon having a 31 iv in all stats is considered as a 6iv mon(It is generally considered good) whereas a mon having random iv is not considered as good iv mon..
Edit: ninja's by @StarryDreamerKitten