Mephiles the Dark is one half of the god Solaris, fused with Iblis. The two were split apart when the Duke of Soleanna tried to harness the Flame of Solaris and failed in the attempt.
Shadow the Hedgehog then sealed Mephiles inside the Scepter of Darkness, which is precisely why Mephiles holds such a grudge against him. When he returns, he does so wearing Shadow's shadow, and sets about trying to end the world.