"And the LORD shut him in" (Genesis 7:16). This teaches that when the waters of the Flood came down and Noah entered the ark, the people of the generation of the Flood came to break open the ark and to kill Noah. What did the Holy One, blessed be He, do? He sent lions and bears and other wild beasts that tear their prey around the ark, so that anyone who sought to break open the ark, they would kill him. This is what is written: "And the LORD shut him in." And just as you say, "My God sent His angel and shut the lions' mouths" (Daniel 6:23) — just as the shutting mentioned there was by means of lions, so too the shutting mentioned here was by means of lions.
The Beasts That Guarded Noah's Ark From the Flood Generation
Midrash Aggadah, Genesis 7:16
ויסגור ה' בעדו. מלמד כשירדו מי המבול ונכנס נח לתיבה באו בני דור המבול לשבר את התיבה ולהרוג את נח, מה עשה הקב"ה שלח אריות ודובים ושאר חיות רעות הדורסים סביב התיבה, שכל מי שהיה מבקש לשבר התיבה היו הורגין אותו, הדא הוא דכתיב ויסגור ה' בעדו, וכמה דתימר אלהי שלח מלאכיה וסגר פום אריותא (דניאל ו כג), מה סגירה האמורה להלן של אריות, אף סגירה האמורה כאן על ידי אריות: