AnkiDroid is trying to sync (download) A LOT OF MEDIA even though all old cards containing data have been deleted

I used the desktop computer to delete all decks and then updated the database. However if i try and sync the database to my phone, it tries to download all the old media which is at least 2 gb.

How to fix this? thanks

anki imports the media when you add it to a card, but does not automatically delete it, when you delete the card.
It is just like copying the file to a folder and putting a reference into the card.
This makes the database smaller and therefore quicker as well as supports multiple notes using the same media without having to have multiple files of the same media.

Long story short: to avoid this, delete all unused media.
You can do so by going to Extra/check Media/delete unused media (or similar, my anki ui is in another language)