If Prince Charles dies who becomes 1st in line why not his brother?

If Prince Charles, The Prince of Wales dies before his Mother Queen Elizabeth II, Charles' oldest son, Prince William will become Heir to the Crown. The Reason that Charles' Sons and not his Brother the Duke of York would become Elizabeth's heir is because that's the way the British monarchy works, rights are past parent to child, so because Charles is first in line so will his son be.