Learn how the Access-Control-Allow-Origin header works, how browsers enforce it step by step, common pitfalls, and what to do when you don