When a company user shares a file within a private chat, it's uploaded to that person's ODfB, when a person shares a file in a Team chat (channel) it's uploaded to the respective folder in the SharePoint library.
Now when a guest performs those actions where is the document stored for both scenario's, since a guest doesn't have a OneDrive and SharePoint license?
A guest user can still upload files in a Team. Because he/she is an external user, a SharePoint license is not required. But that same guest user cannot upload files in Teams from OneDrive, because the user doesn't have a OneDrive in that tenant. So the file upload dialog shows less options:
The uploaded file shows the external guest user as modified by user:
Now for Chat it doesn't work that way. Since the external user indeed doesn't have a OneDrive license, the user cannot share files in a Chat. The paperclip icon just isn't there:
Interestingly enough, that also works the other way around. When an internal user starts a chat with an external user, that file upload option is not available either. Kind of makes sense of course, but on the other hand you could expect a folder created in the OneDrive of the internal user starting the Chat conversation that is shared with the external user. I guess Microsoft didn't want to discriminate ;-) Or they took into account that external sharing settings for OneDrive could differ from the Team in question and that this could result in strange behaviour, makes more sense actually :-)