JKR hasn't out right said why this happens but I feel that Dumbledore's quote: "It is our choices, Harry, that show what we truly are, far more than our abilities" and the quote: "You fail to recognize that it matters not what someone is born, but what they grow to be" both apply. A great example is the Black family. Sirius broke the mold in that he was in Gryffindor and everyone else, including his brother, Regulus black were in Slytherin. Later in life they were affiliated with Voldemort and the Death Eaters, whereas Sirius was in the Order of the Phoenix. Yes, Regulus took the Horcrux, when he realized Voldemort's plan, further proving that the difference in siblings is by choice and by their own discoveries of who they are. This can be seen in regular siblings. They all do share some common qualities among them, but of course there is always the sibling that breaks the mold. Maybe this is the pattern you are looking for?
Harry's children show this in the Deathly Hallows. Harry's children were comfortable with their magical abilities and didn't question it, except the youngest son, Albus, who was worried that he would be placed in Slytherin. Harry also emphasizes to his son that the sorting hat does take into consideration the house you choose to be in, showing that it is our choices of who we are and what we are good at.