It was a war that proved that might and money do not lead inevitably to victory, and its harsh lessons forced America to rethink its role in the world.