At least in the US, if they change the agreement, you get a get-out-of-contract free opportunity, where you can cancel without paying the early termination fee if you refuse to accept the agreement changes.
You are contractually obligated to both Apple and AT&T, so even if you use this loophole to get out of your contract with Apple when they change the contract, your obligation to AT&T continues. IANAL, but my assumption would be that a change in the Apple contract in no way legally changes your AT&T contract, so you are still liable to either honour your obligation to AT&T or pay their (typically exorbitant) cancellation fee.
And note, I don't mean to pick on Apple. I just chose them as a concrete example. It could easily be the other way around or two different companies.