Never ever ask these things.
The books explain it really well.
The stacks only work because they are installed at the age of 1.
If you die before then, nothing to retain. And they can’t be installed until 1 because brain chemistry is not stabilized to that point.
Basically the tech theory argues that all memory and experience is chemically based and transmitted via fluids in the spinal column. The fluids run through the stack which imprints the chemical signatures for these fluids to this special alien metal that the stack is made from (it’s mostly liquid metal inside the casing).
This alien metal has special properties that allows it to take the analog of the spinal fluid and the encoded experiences and store them as data that is then slowly filtered through a digital processor allowing for basic processes like sleaving, backing up, and so forth.
In the beginning the stack was simply a storage device and when one sleave expired an new one was cloned.
Quellcrist changed all that when she developed the algorithm to digitize the analog medium…
And … according to the tv series (which is slighly different) … that is the reason she led the Envoys to begin the uprising to prevent the Corporate Elites from using her tech to simply subjegate whole populations…
Which is what has happened 300 years later…
At least that’s how I remember it.