"And she was buried on the road to Ephrath" (Genesis 35:19). What did Jacob our father see, that he buried Rachel on the road to Ephrath? Rather, Jacob foresaw by the Holy Spirit that the exiles were destined to pass by there. Therefore he buried her there, so that she might plead for mercy. This is what is written: "Rachel weeping for her children" (Jeremiah 31:15).
Why Jacob Buried Rachel on the Road to Ephrath
Midrash Aggadah, Genesis 35:19
ותקבר בדרך אפרתה. מה ראה יעקב אבינו לקבור את רחל בדרך אפרת, אלא צפה יעקב ברוח הקודש שהגליות עתידים לעבור שם, לפיכך קברה שם, כדי שתהא מבקשת רחמים, הדא הוא דכתיב רחל מבכה על בניה (ירמיה לא טו):