A folder full of downloads tells you nothing about where each file came from. With --xattr, curl writes the URL into the file’s extended attributes while it saves it.
Add the flag to any download that writes to a file:
curl --xattr -O https://example.com/tools/file.tar.gz
curl stores the URL in an attribute called xdg.origin.url and, for HTTP, the content type in mime_type. On Linux you read them back with getfattr, on macOS with xattr:
getfattr -d file.tar.gz
xattr -l file.tar.gz
On a Mac the output looks like user.xdg.origin.url: https://example.com/tools/file.tar.gz. I find that handy for the odd tarball or PDF where I want to check months later which version page it came from, without keeping a separate notes file.
Extended attributes are fragile, though. Copying the file to a FAT or exFAT stick, zipping it, or sending it through a tool that does not preserve them drops the URL without a word. The file system also has to support them in the first place; if it does not, curl prints a warning and saves the file anyway. So treat the attribute as a handy hint, not as your only record.
Further reading: curl man page, getfattr man page