The short answer is IT doesn’t.
So, how do we allow www.bank.com to access api.bank.com, while blocking everyone else? Enter CORS.
Why would the server send the request when it knows that the origins don’t match?
So, can’t an attacker create a request to your REST endpoint with whatever Origin and Host header they want?