The key answer is the "apanage" system. The duchies where given "en apanage" to the sons of the kings wich means that they would return to the royal domain after their death (most of the time under the reign of the next king) who would give the same titles to their children. This system was not created until the XIVth century. The apanage system was also not always correctly applied, the duchy of burgundy was supposed to be given as an apanage to one of the sons of Jean II the good but due to the emfeblement of the royal power under the king Charles VI the duke of Burgundy (who became duke of Flanders by mariage) enabled to secure the duchy as an hereditary one thus enabling the creation of the burgundian state.