The @RestController annotation in Spring Boot marks a class as a REST API controller. When the app starts, Spring scans for classes with this annotation and creates beans for them. It then maps HTTP requests like GET or POST to the methods inside these classes. When a request comes in, Spring calls the matching method and takes its return value. Because of @RestController, Spring automatically converts this return value to JSON and sends it back as the HTTP response. This makes it easy to build web APIs that return data in JSON format without extra code. For example, a method returning a Map will send that Map serialized as a JSON response. If @RestController is missing, Spring won't create the controller bean or map requests, so the API won't work. This flow helps developers quickly create RESTful services.