"The woman and her children" - what does Scripture teach by this? It tells that her children are like her. I have here only a maidservant, whose children are like her; from where do I include a gentile woman? Rabbi Ishmael used to say: It is a matter of logic. Just as a Canaanite maidservant, who cannot be betrothed by any man, has children who are like her, so too any woman who cannot be betrothed by any man has children who are like her. And which is this? The child of a maidservant and of a gentile woman. "And he shall go out by himself." It tells that she does not need a bill of divorce from him. I have here only a maidservant, who does not need a bill of divorce from an Israelite. From where do I learn a daughter of Israel, who does not need a bill of divorce from the slave? Scripture teaches, saying, "of them you may acquire a slave and a maidservant" (Leviticus 25:44) - it compares the slave to the maidservant and the maidservant to the slave: just as the maidservant does not need a bill from an Israelite, so too the daughter of Israel does not need a bill from the slave.
Why the Child Follows the Mother and the Servant Departs Free
Yalkut Shimoni on Torah 313:1
הָאִשָּׁה וִילָדֶיהָ, מַה תַּלְמוּד לוֹמַר, מַגִּיד שֶׁוְּלָדֶיהָ כָּמוֹהָ. אֵין לִי אֶלָּא שִׁפְחָה שֶׁוְּלָדֶיהָ כָּמוֹהָ, נָכְרִית מִנָּיִן, הָיָה רַבִּי יִשְׁמָעֵאל אוֹמֵר, דִּין הוּא, מַה שִּׁפְחָה כְּנַעֲנִית שֶׁאֵין לָהּ קִדּוּשִׁין מִכָּל אָדָם, וְלָדֶיהָ כָּמוֹהָ, אַף כָּל שֶׁאֵין לָהּ קִדּוּשִׁין מִכָּל אָדָם וְלָדֶיהָ כָּמוֹהָ. וְאֵי זֶה זֶה וְלַד (שִׁפְחָה וְ)נָכְרִית. וְהוּא יֵצֵא בְגַפּוֹ, מַגִּיד שֶׁאֵינָהּ צְרִיכָה הֵימֶנּוּ גֵּט. אֵין לִי אֶלָּא אָמָה, שֶׁאֵינָהּ צְרִיכָה מִבֶּן יִשְׂרָאֵל גֵּט. בַּת יִשְׂרָאֵל, שֶׁאֵינָהּ צְרִיכָה גֵּט מִן הָעֶבֶד מִנָּיִן, תַּלְמוּד לוֹמַר (ויקרא כה, מד) "מֵהֶם תִּקְנוּ עֶבֶד וְאָמָה", מַקִּישׁ עֶבֶד לְאָמָה וְאָמָה לְעֶבֶד, מָה אָמָה אֵינָהּ צְרִיכָה מִבֶּן יִשְׂרָאֵל, אַף בַּת יִשְׂרָאֵל אֵינָהּ צְרִיכָה מִן הָעֶבֶד גֵּט.