Must be a term in the contract to allow Samsung to do so. My guess: likely that Apple is ending the contract early, and the term is the way for Samsung to cover its investment in the chip plant.
Aside: I am always surprised with the other comments. Do people really think there aren't a bunch of terms on a multi-billion dollar contract limiting what you can do?
I think that's more likely, considering all the rumors that Apple is planning on opening their own chip fabs.