And it appears to me regarding the reason for this law that, behold, following the majority is a Torah principle, yet the Torah said: "And he shall live by them and not die by them," that it should not be possible in any matter to lead to the death of an Israelite (Tosafot Yoma 85a). And against this, to nullify the Torah law that we follow the majority is impossible; therefore the sages said that as long as the majority remains in its place, or due to the principle of "kavuah" which is considered like half-and-half, and half-and-half is certainly like a majority because of the verse "and he shall live by them," then everything that separates from this majority or from this "kavuah"—the law for all of it is like a majority, even though for other laws it is not so, and for this the verse "and he shall live by them" applies. Therefore, when some of them separate—we clear the debris, but when this majority or this "kavuah" is nullified, such as when they all separated—its law is like the rest of the Torah where we follow the majority, and this is according to the system of the Rambam, the Tur, and the Shulchan Arukh. And according to the system of Rashi and his colleagues, the reasoning is as follows: as long as the majority or the "kavuah" all remain in one state, meaning they all separated, the previous status is not yet nullified, and we do not follow the current majority but rather the previous "kavuah," and for this the verse "and he shall live by them" is effective. But when they are divided in their state, meaning these separated and those remained in their "kavuah"—the previous status is nullified and we follow the present, and we follow the majority of those who separated and we do not clear the debris. And "they were all uprooted" means one after the other, for if they were all uprooted at once, behold, this is also "kavuah" (Magen Avraham, subsection 3). However, it could also be that they were uprooted at once and scattered here and there so that the "kavuah" was nullified, as is known regarding the laws of "kavuah" in Yoreh Deah siman 110, see there. (And therefore, regarding an infant found in a city where the majority are heathens—we do not desecrate the Shabbat, since the entire city separates every day here and there, there was never "kavuah," as the Magen Avraham wrote in subsection 2).
ונראה לי בטעם דין זה דהנה רובא דאורייתא, אך התורה אמרה: 'וחי בהם ולא שימות בהן', שלא יוכל לבא בשום ענין לידי מיתת ישראל (תוספות יומא פ"ה.). ונגד זה לבטל דין התורה שהולכין אחר הרוב אי אפשר, ולכן אמרו חכמים דכל שהרוב על מקומו עומד, או מטעם קבוע דהוה כמחצה על מחצה ומחצה על מחצה ודאי הוי כרוב מפני קרא דוחי בהם, דאז כל מה שניזוז מהרוב הזה או מהקבוע הזה - הכל דינו כרוב, אף שלשארי דינים אינו כן, ולזה הוה קרא דוחי בהם. ולכן בפרוש מקצתייהו – מפקחין, אבל כשנתבטל הרוב הזה או הקבוע הזה, כגון דפירשו כולם - הוה דינו כבכל התורה שהולכין אחר הרוב, וזהו לשיטת הרמב"ם והטור והש"ע. ולשיטת רש"י וסייעתו הסברא כן הוא: דכל זמן שהרוב או הקבוע כולם במצב אחד עומדים, והיינו שפירשו כולם, לא נתבטל עדיין הקודם, ואין הולכין אחר הרוב דכעת אלא אחר הקבוע הקודם, ולזה מהני קרא ד'וחי בהם'. אבל כשנתחלקו במצבם, והיינו שאלו פירשו ואלו נשארו בקביעותם - נתבטל הקודם ואזלינן בתר השתא, והולכין אחר הרוב של הפרושים ואין מפקחין. ונעקרו כולם היינו בזה אחר זה, דאי נעקרו כולם בבת אחת הרי זה גם כן קביעות (מג"א סק"ג). אמנם יכול להיות גם נעקרו בבת אחת ונתפזרו זה לכאן וזה לכאן דבטלה הקביעות, כידוע בדיני קבוע ביורה דעה סימן ק"י ע"ש. (ולכן בתינוק שנמצא בעיר שרובה אנסים - אין מחללין שבת, כיון דכל העיר בכל יום פורשים זה לכאן וזה לכאן, לא היה קבוע מעולם כמ"ש המג"א סק"ב).