In the French Defense, cxd4 is often the best move because it challenges White's center, opens the position, and increases piece activity. Even if you don't have more attackers on the pawn, removing White's central pawn can undermine their structure and give you better control of the center. It also prevents White from solidifying their position. Taking on d4 can lead to more dynamic play, opening up lines for your pieces, and forcing White to respond, often with less favorable moves. 6... Nh6 is passive by comparison, and doesn't challenge White as directly.
French Defence When to take d4

Thank you very much, that's just the kind of explanation that I was hoping for
All good my friend, I hope you improve

There are times NOT to take on d4. Taking on d4 too soon gives White the c3-square for the knight.
The first thing is to understand when to play ...c5. There are 2 conditions where you do it:
1) White has played e5, removing all pressure off of d5. 1.e4 e6 2.d4 d5 3.e5 c5
2) White has committed the knight to d2, where getting to c3 would waste 2 tempi. 1.e4 e6 2.d4 d5 3.Nd2 c5! This will often lead to an IQP, but the pawn controls c4 and e4, immobilizing the d2-knight, and there is no pressure on the d-pawn.
DO NOT play c5 if White has not advanced e5 or played Nd2. For example 1.e4 e6 2.d4 d5 3.Nc3 c5?? 4.exd5 exd5 and now pressure on d5 will be too much.
In the winawer, you are enticing e5 by pinning the guard of the e4-pawn to the king so that you can play c5. 1.e4 e6 2.d4 d5 3.Nc3 Bb4 4.e5
So now, when do you take on d5? For example, 1.e4 e6 2.d4 d5 3.e5 c5 4.c3 cxd4 is a mistake, giving White the c3-square for the knight. You want to play ...cxd4 when White cannot recapture with the pawn, when it will win a pawn, when Nc3 is no longer possible, or when dxc5 is a problem.
1.e4 e6 2.d4 d5 3.e5 c5 4.Nf3, while not the only option, 4...cxd4 is an option as White must take with the knight or gambit the pawn and play 5.Bd3.
1.e4 e6 2.d4 d5 3.e5 c5 4.c3 Nc3 5.Nf3 Qb6 6.Bd3, here 6...cxd4 should be played first, then 7.cxd4 Bd7 8.O-O Nxd4 and NOT 6...Bd7 because 7.dxc5 is strong for White.
1.e4 e6 2.d4 d5 3.Nd2 c5 4.Ngf3, now someone that plays 4...exd5 after 4.exd5 should play 4...Nc6 while a 4...Qxd5 player should play 4...cxd4.
1.e4 e6 2.d4 d5 3.Nd2 c5 4.exd5 exd5 5.Ngf3 Nc6 6.Bb5 Qe7+ 7.Be2 Qc7 8.O-O Be7 9.Re1, here you take on c4 to open up lines to get castled. 9...cxd4 10.Nb3 Bb4+ 11.Bd2 Bxd2 12.Qxd2 O-O etc.
Now a case where you do not trade or keep the pawn on c5. 1.e4 e6 2.d4 d5 3.e5 c5 4.c3 Nc6 5.Ngf3 Qb6 and now 6.a3 is to try to get in 7.b4. 6...c4 stops that. Without a3 played, ...c4 is weak because a pawn still on a2 helps promote the b3-break.
When playing the French as black, there are many times where the engine says that I should have taken d4 (cxd4), even though I have less attackers on that piece than White has defenders. Can someone please explain to me what the advantage of taking d4 is, when I don't have enough attackers to follow the chain of takes to the end?
As an example, I have a game that I just played here. It says that 6..Nh6 is an innacurracy, and I should have played cxd4 instead. Perhaps someone can explain why taking the pawn is the best move in this position, because I don't understand? What are the conditions that should be met before taking the hotly contested d4 pawn? (aside from the obvious situation of black having a greater number of attackers on that pawn)