Rabbi Abba bar Kahana in the name of Rabbi Yochanan: A parable to a king who betrothed a noblewoman and wrote her a generous marriage contract, "Such and such bridal canopies I will make for you, such and such ornaments I will give you, such and such treasuries I will give you." Then he left her and went off to a distant province, and he stayed there many years. Her companions taunted her, saying, "How long will you sit waiting? Take yourself a husband while you are still young, while your strength is upon you." She would go into her house, take out her marriage contract, read it, and be comforted. After many days the king came back from the distant province and said to her, "My daughter, I am amazed that you waited for me all these years." She said to him, "My lord king, were it not for the generous marriage contract you wrote me, my companions would already have turned me away from you." So too, because in this world the nations of the world taunt Israel and say to them, "How long will you die for your God and give your lives for Him and be killed for Him? How much suffering does He bring upon you, how much contempt does He bring upon you, how many afflictions does He bring upon you? Come over to us and we will make you generals and governors and commanders." And Israel enter the synagogues and study houses, take a Torah scroll, and read in it, "I will walk among you and be your God... and I will increase you and multiply you and establish My covenant with you" (Leviticus 26:9), and they are comforted. When the End arrives, the Holy One, blessed be He, will say to Israel, "I am amazed that you waited for Me all these years." And Israel will say before the Holy One, blessed be He, "Master of the worlds, were it not for the Torah scroll You wrote for us, the nations of the world would already have turned us away from You." This is what is written, "This I recall to my heart, therefore I have hope" (Lamentations 3:21). And so David said, "Unless Your Torah had been my delight, I would have perished in my affliction" (Psalms 119:92).
The Torah as the Marriage Contract That Kept Israel Faithful
Pesikta DeRav Kahana 19:4
[ד] ר' אבא בר כהנא בשם ר' יוחנן למלך שקידש למטרונא וכתב לה כתובה מרובה, כך וכך חופות אני אעשה ליך, כך וכך תכשיטין אני נותן ליך, כך וכך טיסבריות אני נותן ליך. הניחה והלך לו למדינת הים, ושהא שם שנים הרבה, והיו חברותיה מונות אתה ואומרות לה, עד אימתיי את יתיבה, סב ליך בעל עד דאת טלייה עד דחייליך עליך, והיתה נכנסת בתוך ביתה ונוטלת כתובתה וקורא בה ומתנחמת. לאחר ימים בא המלך ממדינת הים א' לה, ביתי תמיה אני היאך הימתנת לי כל השנים הללו, אמרה לו אדוני המלך אילולי כתובה מרובה שכתבת לי כבר היו חבירותי מאבדות אותי ממך. כך לפי שבעולם הזה אומות העולם מונים לישר' ואומרין להם עד מתי אתם מומתים על אלהיכם ונותנין נפשותיכם עליו ונהרגים עליו, כמה צער הוא מביא עליכם כמה בוזים הוא מביא עליכם כמה ייסורים הוא מביא עליכם, בואו לכם אצלינו ועושין אנו אתכם דוכסין ואפרכין ואיסטרטיליטים. וישר' נכנסין לבתי כנסיות ולבתי מדרשות ונוטלין ספר תורה וקורין בו והתהלכתי בתוככם והפריתי אתכם והרביתי אתכם והקימותי את בריתי אתכם (ויקרא כו:ט) ומתנחמים. כשיגיע הקץ הקב"ה או' ליש' תמיה אני היאך הימתנתם לי כל השנים הללו, וישר' אומ' לפני הקב"ה רבון העולמי' אילולי ספר תורה שכתבתה לנו כבר היו אומות העולם מאבדין אותנו ממך, הד"ה דכת' זאת אשיב אל לבי על כן אוחיל (איכה ג:כא). וכן דוד או' לולי תורתך שעשועי אז אבדתי בעניי (תהלים קיט:צב).