Compose is not doing anything special to resolve resources, it is just using the standard JVM classloader resolution rules. The path is "raw/image.svg" because gradle adds"src/main/resources/" to the classpath and "raw/image.svg" is the resource path relative to the classpath.
See https://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html#getResource(java.lang.String) for details.