Obama’s positioning for spending fights benefits from careful planning, but unforeseen events play major role