Lifting up the holy sparks is also known as nitzotzos dikedushah (see footnote 10, see also this answer). I recently saw this article quoting the Ari HaKodesh in saying that the work the Jewish People did in Mitzrayim, was in order to lift up the sparks that were scattered after the sin of Adam HaRishon, in order to purify them and put them into the right (holy) place.
The Ari is quoted saying:
The Ari HaKadosh explains that when the Yidden were in Mitzrayim, the hard work was in order to lift up all Nitzotzos Hakedushah (- holy sparks, so to speak) that fell in wrong places after the sin of Adam Harishon. Through the hard work and suffering they lifted up most of it. We still need work on the rest of the Nitzotzos and when they are all completely restored, Mashiach will come.
The Levi’im who didn’t work hard, did the work of lifting the Nitzotzos by Torah and Avodah.
1. Where does the Ari HaKadosh say this (translation is very welcome)? and does the Ari give an explanation on what this exactly means, that "the hard work was in order to lift up all the Nitzotzos HaKedushah"?