At the Paris Peace talks back in the 70s, an American general noted to his North Vietnamese counterpart, "You never defeated us on the battlefield." The reply: "That is true, but it also is irrelevant".
In none of the conflicts you cite were American fighting forces defeated. Be careful, raybrag, to not confuse military with political outcomes.
You make a good point in that in that "it's almost impossible to predict where, when, or how we'll fight our next adversary" (your words). Considering the military results in all these conflicts, we military planners must have done something right. If not in foresight then certainly in adaptation to the war at hand.
Just as the FDNY learns from its previous incidents, from the Chiefs to the firehouse kitchen table, so too does the military, from the Pentagon to the squad leader. We all only know what we already know. Foresight (and clairvoyance) can only be based on that.
Just as the City of New York still has not burned to the ground, none of us are speaking German, Japanese, Russian, Korean, Vietnamese, Arabic, etc.,...yet.
But all that's still up to the politicos, not those in the uniforms (civil or military) who have to get it done.