It's a stretch to call them "ill-equipped" in Vietnam and Afghanistan, considering that the insurgents won both campaigns (with generous military assistance from the opposing superpower). No, they didn't have armored infantry - but they had surface-to-air missiles, anti-personnel mines, anti-tank missiles, and automatic submachine guns, all provided by the opposing superpower. The U.S. lost many aircraft against the North Vietnamese, and the Soviets lost many tanks and helicopters against the mujahideen in Afghanistan.
steve19 also makes the very good point that these weapons did fall into the hands of the enemy: most of the Taliban were trained by the CIA, and the weapons our forces faced in Afghanistan were largely ones we had sold to the mujahideen in the 80s. Now the weapons left behind in Iraq are largely in the hands of ISIS.
The point of this article is that the U.S. is likely to face similar asymmetric threats in any future war, where the opposition doesn't have the same weapons as us but they do have weapons that are very effective at countering us.