The purpose and fulfillment of the messianic era and the resurrection of the dead is twofold:
It is for the true revelation of God’s glory and the Divine in the world, and for the utter banishment of evil, both contingent upon our actions.
This is accomplished when the Jewish people as a whole draws down the Godly light into its collective vital soul.
That is, when each one of us fulfills the 248 positive mitzvot, our individual vital souls (regarded as one collective soul) become infused with this divine light.
This collective soul is powerful enough to elevate the entire world along with it.
Rabbi Adin Steinsaltz