With Teams, the distinction is pretty easy: Within a Team, the file gets uploaded to the Team's SharePoint site. If you share a file in the Chat module, it gets uploaded to your own OneDrive.
I only discovered it by chance while roaming my onedrive directory.