The merchant does have a responsibility to not charge more than was authorized, but if they fail to fulfill that responsibility, then it being corrected is dependent on the customer. You use the term "credit card company", which when used by lay people can be ambiguous as to whether it's referring to the issuing bank (the bank the money is coming from) or the network (VISA, MC, etc.) While an issuing bank may have something in place that would flag the transaction as suspicious, it's not their place to tell the cardholder they can't spend $500 for a cheesecake. In addition, the issuing bank is told just the name of the merchant and the amount, it's not provided a list of what was purchased. For all it knows, that $500 was for twenty cheesecakes, or a bottle of wine, etc. The network is even less likely to proactively get involved.
If a merchant charges a credit card in the absence of an authorization, or in excess of an authorization, the cardholder can file a chargeback. However, credit card networks generally require that the cardholder make an attempt to resolve the issue directly with the merchant first. So the customer would have to contact the restaurant, and if the restaurant refuses to credit the account with the disputed amount, then the customer can file a chargeback with the issuing bank.
The issuing bank can then just eat the cost themselves (for small amounts, this can be the most cost efficient choice), or send the chargeback along to the acquiring bank, which is the bank that collects money for the merchant. The acquiring bank can then pass the chargeback along to the merchant, or dispute the chargeback (this is known as re-presentment: they're presenting the transaction again). If the acquiring bank disputes the chargeback, then the network has procedures for resolving the dispute, including arbitration if it gets that far.
In the scenario you describe, the restaurant would almost certainly lose the dispute, as they would not have any documentation for the amount they charged (unless they engaged in some forgery or something). In addition, there currently are three main ways card are read: swipe (running the magnetic strip through a reader), dip (reading the EMV chip), and tap (using the contactless capability). Most restaurant, at least in the US, use swipe (if you look on your receipt, you'll likely see an "S" for swipe). If a merchant uses swipe, and the card has chip capability, then the merchant pretty much automatically loses any dispute (the credit card networks really want the more secure chip used, so they strongly incentivize this).
Credit card networks serve just as facilitators between banks; there's the issuing bank that is in charge of your card, and the acquiring bank that collects money from the issuing bank and disburses to the merchant. In the case of a successful chargeback, the network will instruct the acquiring bank to send the money back to the issuing bank. It's up to the acquiring bank to then get the money back from the merchant; the network isn't involved in that.