I'm using the spring saml example application spring-security-saml2-sample. Here I discovered two parts with generated metadata:
So why do I need SP generated metadata twice? If MetadataGenerator is configured, I've even a static version (uploaded to IDP) and a dynamic local version.
You don't. You can either auto-generate metadata, or pre-configure them. Both variants work. It's recommended to use pre-configured ones for production in order to remove any potentially environment-dependent auto-generation during application startup.