As you might be knowing, all these three annotations are used for auto bean detection via classpath scan in Spring framework.
If you ask for there differences, there is technically no difference between them. But still, you can’t use them interchangeably as every auto component scan annotation should be used for a special purpose and within the defined layer. Below I have elaborated all three of them:
@Component: It is a basic auto component scan annotation which indicates that an annotated class is an auto scan component.
@Repository: You need to use this annotation within the persistence layer that acts like database repository.
@Service: It indicates that an annotated class is a Service component of the business layer.