Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:106:4

Who has fed them, ˹saving them˺ from hunger and made them safe, ˹saving them˺ from fear.  

Who has fed them against, that is, on account of, hunger and made them secure from, that is, on account of, fear: they used to suffer hunger in Mecca due to the lack of crops and they feared the army of the Elephant. Meccan or Medinese, or half and half; it consists of 6 or 7 verses.
القرآن:١٠٦:٤

الَّذِي أَطْعَمَهُمْ مِنْ جُوعٍ وَآمَنَهُمْ مِنْ خَوْفٍ  

{الذي أطعمهم من جوع} أي من أجله {وآمنهم من خوف} أي من أجله وكان يصيبهم الجوع لعدم الزرع بمكة وخافوا جيش الفيل.