Megatron died at the end of TF3, right? I'd imagine that the Autobots would somehow have ejected his body into space to get rid of it. They tried burying him in the sea at the end of TF1, but that obviously didn't work so space would seem a more permanent solution.

That would set up a perfect scenario where Unicron would come across Megatron's body in his slow journey towards earth, and he could rebuild him into Galvatron for some nefarious purpose. Galvatron would be sent on ahead to engage the Autobots before Unicron's arrival.

In TF1, his body was intact and whole despite the cube lodged in his sternum.