For when what remained of the primordial perfection was joined together with what newly came into being in the Tzimtzum, i.e. the power of deficiency – this produced the Sefirot. But this very power of deficiency itself came forth through the will of Eyn Sof, blessed be He. All that we can discern is that the Sefirot contain what exists by virtue of the primordial existence, which is entirely good, together with what exists on account of what came newly into being through the power of His will – deficiency, which is the root of evil. However, everything is one extension: what is left of the perfection together with the newly-created deficiency jointly constitute the Sefirot.
Why the Infinite Had to Shatter to Become Finite
Kalach Pitchei Chokhmah 30:52