A useful adage : no plan survives first contact with the enemy. Another : a piss-poor plan is better than no plan at all. (It's still a piss-poor plan, of course.)
After first contact, the competence of the commanders involved is crucial, and so is the abilility of higher commanders to trust their input and adjust the plan. From what I've been reading about the Iraq invasion, commanders on the ground recognised early on that the guerilla threat was greater than envisaged, and wanted to stamp it out before it got rooted. They had a tactical encyclopedia to call on, and very professional soldiers. Instead the plan took precedence - drive on to Baghdad where they'll stand and fight and be destroyed. Any input suggesting that the plan be modified was regarded as hostile. The partisans had time to get rooted, and here we are.