Age verification, as it would concern those (somehow) financially interested (I guess, looking at it), has (apparently) nothing to do with the law in its own right (this is absurd).
I'm working from the assumption that if "they," meaning said company, do not wish for you to use their website, app, etc., then that necessarily means that they do not wish to do business with you in any capacity, and that this is their own discretion whenever it's not a legal requirement—perfectly reasonable things to assume, I think.
So: the following is copied directly from the official U.S. McDonald's website.
"The online services are not intended to be used by, or targeted to, anyone under the age of 18 years old. You must be at least 18 years old to use the online services."
https://www.mcdonalds.com/us/en-us/terms-and-conditions.html
By demonstration, the reason why they—literally McDonald's in this case—would tell you they want age verification on their site if you were to ask them and we're pretending they wouldn't lie to you, is because they do not want your money in the event that you're too young to do business with them according to themselves, and the reality that selling literal food to kids is, obviously, perfectly legal is irrelevant because they believe themselves above the law according to their own website.
If you are a United States citizen, or if you're visiting the U.S. from anywhere else elsewhere on Earth or from another planet while we're at it, and you are eighteen years of age less one day: McDonald's USA, LLC doesn't want your money, kid.
If you're between sixteen and eighteen and years of age, and the adult(s) responsible for you, along with some judge in some court in some jurisdiction, have agreed to emancipate you: McDonald's USA, LLC still doesn't want your money, legally adult kid.