It is VERY LARGELY down to the owners. The best-mannered animals I ever dealt with (apart form our current Goldie) were "Hey You" and "Hey You"'s Mother - both Rotties, both big buggers. Well-trained and kept under control by their owner. That is the difference.My folks used to keep golden retrievers.
Had a few litters, sold them on, but then they became trendy.
Fortunately the kennel union, which oversees breeding, gives out family trees back about 9 generations.
Potential stud or dam was examined, and kennel names compared. If too much commonality then a dog shagging session was off.
However, some folk wanted cute puppies, not pedigree. And some breeders didn't care.
Just like humans ... Think inbred types like Cornwall, Norfolk and house of Windsor... As soon as you start putting cousins with cousins you get problems.
I'm sure most pitbull, rottweiler etc hounds have severe issues. Because they aren't bred according to guidelines.