Spring Boot applies auto-configuration when the main application class is annotated with @EnableAutoConfiguration or @SpringBootApplication (which includes it). This triggers Spring Boot to scan and apply auto-configuration classes automatically.
Spring Boot auto-configuration classes use conditional annotations like @ConditionalOnClass to check if required classes are present. If the class is missing, the auto-configuration is skipped silently.
@ConditionalOnMissingBean is used to apply auto-configuration only if a certain bean is not already defined in the Spring context.
Spring Boot scans packages starting from the main application class package. If your custom configuration is outside this scan path, it will be ignored.
Spring Boot applies auto-configuration classes first, then user-defined @Configuration classes are applied later. This allows user configurations to override auto-configured beans.