@Martin Kallukalam Thanks for reaching out. Actually, we only store group mapped with users which means we don't store 1000 groups we only store users with their corresponding group and not all the groups in Azure AD.
When setting up Azure AD groups in Portal, APIM queries the Azure AD Graph API to retrieve the list of groups that are associated with the users in your APIM instance. Since you are only storing the groups that are mapped to users, APIM will only need to retrieve a subset of the total number of groups in Azure AD. This should help to reduce the amount of data that needs to be loaded and can improve the performance of the synchronization process.
do let me know incase of further queries, I would be happy to assist you.