In order to follow what happened in this situation, there are 12 people you have to be aware of. This becomes slightly more confusing than one would think, because 4 of those 12 are named Joan, and 2 more are named Phillip. There are also 5 territories or holdings to know about, 2 of which are called Burgundy (a county and a duchy, held separately).
The first person is Robert II, Duke of Burgundy. He is the common ancestor of all the folks involved in the crisis, and it was various peoples' relationship to him that was the source of the trouble. He died in 1306.
Robert II had a number of children, four of whom are relevant to the story. The first is Hugh V, eldest son of Robert, who was Duke of Burgundy after him, but died childless in 1315. With his brother's death, the Dukedom passed to Odo IV. There will be two sisters who will pop up later.
Odo IV married Joan III, countess of Burgundy & Artois (note that this is the county, not the duchy, of Burgundy), and they had a son named Phillip. Phillip married a different woman named Joan, who was countess of Auvergne and Boulogne, and they in turn had another son named Phillip. The younger Phillip is known as Phillip of Rouvres.
Now, the elder Phillip died in 1346, and his claim on the Dukedom of Burgundy and the counties of Burgundy and Artois passed to his young son Phillip of Rouvres. The child's grandmother Joan III died in 1349, passing along the counties of Burgundy and Artois, and Odo IV died in 1350, leaving him the Duchy of Burgundy. At this point we have a small child, Phillip of Rouvres, who is the following: Duke of Burgundy, Count of Burgundy, and Count of Artois. His mother died in 1360, and he then inherited then the counties of Auvergne and Boulogne from her. He has no siblings. A marriage was arranged and he does get married as a teenager, but he dies in 1861, before having any children.
Because his various titles were inherited separately from three different lines/relations, rather than being inherited as a "package deal" from a single holder, they moved to the next holders in their respective chains separately from each other.
Phillip of Rouvres held the counties of Auvergne and Boulogne from his mother, and following primogeniture succession, they went to his mother’s uncle. There wasn't any dispute here. He held the counties of Burgundy and Artois from his paternal grandmother, and following primogeniture succession, they went to his paternal grandmother’s sister. There wasn't any dispute here either. He held Duchy of Burgundy from his paternal line, back to Robert II, and this is where things got messy.
If you recall, I mentioned there would be two sisters who popped up later. This is later. Margaret of Burgundy and Joan of Burgundy were daughters of Duke Robert II. Margaret had a daughter named Joan (of Navarre), who in turn had a son who became King Charles II of Navarre. Margaret and Joan both were dead by the time of the succession, but Charles II wasn't. Joan of Burgundy had a son, who was King John II of France. Joan was also dead by the time of the crisis, but John II wasn't.
Each of these two kings had a claim. The primogeniture heir would be Charles II of Navarre, as the eldest surviving child of the eldest surviving line of Robert II. The heir by closest blood proximity (an older and fading system, but still around) was John II of France, as he was a generation closer to the common ancestor, being a grandson of Robert II rather than a great grandson.
At this point, we've covered the people and the places, now we have to look at the politics. This succession occurred at a time when France was nowhere near its current size, and there were many smaller dukedoms and kingdoms around it that were fiercely independent, including Burgundy itself. It also occurred during an ongoing war, in which France and Navarre were on opposing sides. The Burgundians had been siding with France, and so favored John II as their duke, rather than their enemy Charles II. John II was happy to take Burgundy, and the Burgundian nobility were willing to pledge fealty to him, but did so as duke of an independent nation, not desiring to be part of France (that is to say, they acknowledged his claim due to blood, not due to his position as a king). When John II tried to then incorporate Burgundy in to France by claiming as Duke to give it to the King, and as King to accept it, resistance arose. John II relented, and eventually he granted the duchy of Burgundy to his youngest son, whose descendants would remain in power there until Burgundy was finally absorbed by France around a century later.