They explained it in their announcement at https://discord.com/press-releases/update-on-security-incide...
TL;DR: The IDs were used in age-related appeals. If someone's account was banned for being too young they have to submit an ID as part of the appeal. Appeals take time to process and review.
Discord has 200,000,000 users and age verification happens a lot due to the number of young users and different countries.
This is corporate cover speak for “we keep all data”
Why should we suspect the age verification and age-related appeals would involve different teams or processes?