updating – How can I update drupal without losing some folders / files from: Core, Vendor?

I recently saw in the status report that I have a security update. I have the version: 9-1.4. The update is at: 9-1.5.
I tried to manually update on a local development site and after the update I saw that php mailer is gone. That’s when I remembered that the vendor file had the php mailer library.
My question is when you do an update, how do you know what folders or files are in the folders: core, vendor?
I don’t think a person can remember if two months ago he installed a library I want to mention that php mailer was installed with: composer.