"You want to kill me. That is what I want. Kill me, and my spirit will pass into you. And all the Sith that live in me."
Darth Sidious to Rey, The Rise of Skywalker
In The Rise of Skywalker, Darth Sidious invites Rey to strike him down, so that his spirit and that of all the Sith in him, would pass into her, making her the new Sith Lord.
Is that the general rationale behind the Rule of Two? That by killing the master, their spirit passes into the apprentice. Darth Sidious does call it a ritual, hinting that it has been done more than once. Also, he mentions all the Sith that live in him, which seems to indicate that this has happened numerous times, possibly every time an apprentice kills their master.
The answers to this question touch upon it, but do not fully answer my questions.