By default the user directories configured in Confluence (ADMINISTRATION > USERS & SECURITY > User Directories) are used to fill the user profiles.
In some cases companies have two LDAPs for the same users, but with different information. A common use case would be to manage your users (name, password) and groups (confluence-admins) in a user directory managed by Confluence, but maintain user profile data (position, location etc.) in a different directory. If that's the case for you and you want to retrieve additional data for profile fields from an LDAP different to the one configured in confluence, you can configure a separate LDAP resource under (ADMINISTRATION > CUSTOM USER PROFILE > DATA SOURCES).
Please note: If you configure an LDAP resource here, the CUP add-on will then use this resource exclusively to fill the fields you have configured for user profiles. It won't merge information with the LDAP configured in Confluence.