How can someone be in this country as a foreigner with an expired passport?
Yes, sure. You are wrong.
Having a passport that is valid is a requirement to be here or you will not be legal to stay here.
There is no requirement like that. You are wrong.
You have to make sure you renew your passport and I-94 cards are issued only until the experation of the passport unless a mistake is made which rarely happens.
You do not have to renew your passport. You are wrong.
I have seen it happen but normaly at customs your stamp on the I-94 cars is up to the experation date in the passport. Your US drivers license will match that day.
There are specific rules for the immigration officer until what date to admit you. In certain cases they are tied to the expiration date of your passport (like B-2),
Documents required: Passport valid for a minimum of 6 months beyond the period of admission, unless otherwise provided for or waived.
including 6 months rule. In certain cases they are not tied to expiration date of your passport (like F-1)
Documents required: Passport valid for 6 months, unless exempt.
, even though the passport has to be valid on the date of your entry, including 6 month rule.
See the difference in CBP inspector's field manual?
However, even in case of B-2 you do not have to extend your passport in order to change your status. The rule quoted is relevant only upon your initial entry. Once you got your I-94, you are in status. You do not need your passport anymore to be in status.
You are illegal once your I-94 card expires even if your visa stamp is still valid.
Correct. But whether your passport expired or not has no effect on validity of your status. Moreover, you can change your status or proceed with AOS when you no longer have a valid passport, in case you are still in status. That is the subcet of the question raised.
That is what I suspected. You have a wrong feeling of common sense.