The wiki on dien bien phu compares it to Khe Sanh and to a prior french air drop supplied garrisoning victory. Giap learned from the earlier loss about the importance of positioning his artillery and getting a heavy AA presence. In the earlier battle, the french controlled the high ground and Giap used frontal assaults. The theory was that DBP could disrupt Viet Minh operationis in Laos, another French area. IT was set up as a deep forward base in the northwest. however, Dien Bien Phu was in the bottom of a valley. The french did not realize how much artillery and anti-aircraft guns were up in the surrounding hills. The french artillery commander committed suicide the first night of the battle when he realized what a mistake he made. the artillery knocked out HQ bunkers in a couple of positions and made the air strip unusable. Still, the Viet Minh took more casualties in the early stages of the battle than the french forces. however, the inability of the french, with covert US help, to resupply the troops and provide effective air support let Giap knock off the french strong points one by one.
It's not clear whether Khe Sanh was an attempt to distract the US from the main Tet offensive or whether Giap thought he could pull off another Dien Bein Phu. Khe Sanh was another forward base, it was much closer to US bases so resupply was simpler and in greater quantity. Also, air support was much more effective, and it was on the high ground. Truly an amazing, courageous effort by the marines, air cavalry, and other units involved.