xxxxxxxxxx
@EnableAutoConfiguration is to enable the automatic configuration feature of the Spring Boot application which automatically configures things if certain classes are present in Classpath.
For example, it can configure Thymeleaf, TemplateResolver, and ViewResolver if Thymeleaf is present in the classpath.
@EnableAutoConfiguration also combines @Configuration and @ComponentScan annotations to enable Java-based configuration and component scanning in your project
On the other hand, @SpringBootApplication annotation indicates a configuration class that declares one or more @Bean methods and also triggers auto-configuration and component scanning.
This is a convenience annotation that is equivalent to declaring @Configuration, @EnableAutoConfiguration, and @ComponentScan.
The Spring Boto auto-configuration feature tries to automatically configure your Spring application based upon the JAR dependency you have added in the classpath.
For example, if HSQLDB is present on your classpath and you have not configured any database manually, Spring will auto-configure an in-memory database for you.
By default, this auto-configuration feature is not enabled, and you need to opt-in for it by adding the @EnableAutoConfiguration or @SpringBootApplicaiton annotations to one of your @Configuration classes, generally the Main class which is used to run your application.
Though, this is just the tip of the iceberg. Spring Boot auto-configuration takes more than 200 such decisions to configure your application, If you are interested in learning more about auto-configuration then Learn Spring Boot Rapidly course on Udemy is an excellent course to learn Spring Boot in depth