Cross-Origin Resource Sharing (CORS) allows browsers to make requests from React apps hosted on different domains than the Rails API. The rack-cors gem configures CORS middleware with fine-grained control over origins, methods, and headers. In development, I allow localhost origins with various ports for flexibility. Production restricts origins to specific domains. The credentials: true option enables cookies and authentication headers. expose headers make custom headers like Authorization accessible to JavaScript. Preflight OPTIONS requests happen automatically for complex requests. Wildcard origins (*) work for public APIs but disable credentials. Proper CORS configuration is essential for SPA architectures.