Hamas has spent years stockpiling desperately needed fuel, food and medicine, as well as ammo and weapons, in the miles of tunnels it has carved out under Gaza.
Trucks carrying aid have been driving through the Egyptian border gate at Rafah before heading more than 40km (25 miles) to the Egyptian-Israeli crossing of Al-Awja/Nitzana, south of Egypt’s short border with Gaza, for inspection, as agreed in negotiations with Israel. Trucks return to Egypt empty, with the aid reloaded onto separate trucks for delivery into Gaza.
Gaza also shares a border with Egypt. Egypt is not under IDF control.
https://www.reuters.com/world/middle-east/why-gazas-rafah-border-crossing-matters-why-egypt-is-keeping-it-shut-2023-10-17/
Trucks carrying aid have been driving through the Egyptian border gate at Rafah before heading more than 40km (25 miles) to the Egyptian-Israeli crossing of Al-Awja/Nitzana, south of Egypt’s short border with Gaza, for inspection, as agreed in negotiations with Israel. Trucks return to Egypt empty, with the aid reloaded onto separate trucks for delivery into Gaza.
Egypt has agreements with Israel giving them right of refusal for any border crossings. https://en.wikipedia.org/wiki/Rafah_Border_Crossing
That being said, Egypt is no friend of Hamas, but sending UN aid in doesn’t cost egypt anything.
Egypt’s Foreign Minister Sameh Shoukry told the BBC’s Newshour programme that from Egypt’s perspective, “the Rafah crossing on our side is officially open”
IDF doesn’t control it, Egypt just doesn’t give a flying fuck about Hamas. So they don’t mind Israel looking through the tracks.