If i recall correctly by default it uses the location of your spring boot application class (usually where your main method is) to determine the packages to scan (it scans that and all child packages)
See Component Scanning with Spring Boot
But an annotation can be used to change its packages to scan