All these are Component annotations, that means, they all are managed beans.
And all are present in spring stereotype package.
@Component: Its a generic annotation for the other 3 annotations. Any class marked as @Component are managed beans. If you were not sure to which layer this class belongs to you can use this annotation.
@Service: For business service layer.
@Repository: For data layer.
@Controller: For web layer.
Question: If all the above annotations are same, then why do we use either of them ?
Answer:
Below are the benefits:
1. Readability.
2. You can identify your components and add functionality to them based on their type. For eg., in your business layer you want to log all the incoming requests it would be easy to do that with the help of AOP. And, suppose for data access layer you want spring to handle your persistent related exception then you can just put @repository and let spring to handle all the exception. The generic exception which is called for this is DataAccessException, which is an Runtime exception, unlikely the SQLException which is a checked type of exception.