I think @FrVaBe has gave the best answer in this topic.
A dependency identified as optional
is literally optional, i.e. the application/library is not bound to it to do what it needs to do. It just enhances functionalities if the dependency is present in runtime's class path.
In contrast, A provided
dependency is mandatory, it's just that the jar doesn't contain it by itself. In other word, the application/library can not be executed/used without the dependency but it relies on others (apps, libraries, environments) to provide it in runtime. For example, consider building a spring-boot web application to be deployed traditionally (without embedded tomcat). This application needs tomcat to be able to run as a server application, but tomcat will be provided later.