In X-Men: Apocalypse, Apocalypse extends his lifespan by changing bodies, a procedure where he takes over the body and powers of his new host.
After being betrayed and buried deep into the earth in Egypt, the powers of Charles Xavier were extra useful for him since he'd never be betrayed (or caught off-guard) again.
For this, he kidnapped Charles Xavier and tried to move into his body. If he was to succeed, Xavier would die. Did Magneto know about it? Did he accept it as a necessary sacrifice for his revenge from mankind or was he not aware of Apocalypse's plan?