How is a website any different?
> So where do those terms come from?
State law. That's all. The website can not dictate any terms whatsoever.
To your specific points:
A restaurant is private property - they can ask me to leave if I don't wear a shirt, but they can NOT compel me to actually wear the shirt. They can't fine me for going there without a shirt, they can't do anything at all, except ask me to leave.
If I buy food from a restaurant, that's a purchase and not a contact, and it uses the various state laws that govern that. But the restaurant can NOT add extra conditions. If a restaurant puts up a sign that said "by buying food here you agree to ...." - that sign is meaningless, and has no validity.
A purchase order requires the signature of the buyer. Merely stating a term and saying "by doing ...." is meaningless.
Those terms you find on the back of a receipt sometimes? Meaningless. They can say what the store will do, and under what conditions, but they can do nothing whatsoever to the purchaser that state law does not provide.