The new compileOnlyApi dependency introduced in Gradle v6.7 allows using the new scope for dependencies that must be present while compiling the code, but not required in runtime.
Also, the api part exposes the dependency of the library to the consumers, so they are e.g. able to rely on the same annotations while running their annotation processors with the library.
An example of a dependency that'll benefit from the new scope is ErrorProne annotations. The annotations are required during the compile-time and give hints to other users about the library behavior but are not really used in runtime.