There are many other reasons for giving someone a new contract other than them 'earning' it.
Maybe he signed on a lesser contract last year, with the agreement that he'd get a new deal if we stayed up. Or maybe there was a release clause in his contract and the club wanted to remove it.
When Yann got his new deal last September, even though we tried to sell him in August, that was presumably a contractual obligation on our part. When Shaun MacDonald got his recently, it was presumably to stop him from talking to other clubs in January and leaving for nothing.