It looks like the US has been conducting reconnaissance flights over Iran, and air defenses have fired at several drones, along with attacks on ships crossing the Hormuz. It's just speculation, but the US likely sought Iranian protection before a possible strike after the midterms.