My sync target is a folder I sync via Google Drive, in order to share the same Joplin db with multiple computers. I thought something like /home/myUser/DriveFolder/joplinDB/.resources contained all the data from my notes inside the hidden .resources folder.
But I just created a note and added a PDF as attachment, and when right clicking the file name link and selecting "Reveal file in folder", I see that the location of the file is /home/.config/joplin-desktop/resources, along with thousands of other files. This other resources folder is in my home folder, but outside my selected sync target.
What is the difference between those two resources folders? I'm trying to understand where all the data is actually stored, since my goal is to have Joplin in more than one machine. If I point another instance of Joplin to the sync target on Google Drive, will it work, does it contain all data from all my notes?
The files in ~/.config/joplin-desktop are your actual local data files for Joplin. The folder contains config files, a database (database.sqlite) containing all your notes and a resources folder containing any attached files. That is why "Reveal file in folder" shows ~/.config/joplin-desktop/resources. That is where Joplin is storing that resource / attachment.
The other Google Drive folder location is the sync target location and contains copies of all your notes, resources and other data as individual files. This is the data that Joplin uses to sync clients. Its only purpose is to enable the transfer of data to other clients. In your case when you use file system sync this location is also on your computer. However if you had used WebDav, Dropbox etc.this is the data that would have been sent directly to that cloud service. If you had End To End Encryption (E2EE) switched on, all the data in the Google Drive folder you created would also be encrypted and so unreadable.
If another Joplin client on another computer that has Google Drive installed uses a file system sync to its copy of the same folder the first client used it will import that data into its own database and resources folder in its own local data folder in ~/.config/joplin-desktop.
Summary:
Everything in ~/.config/joplin-desktop is the actual Joplin note data and is effectively unique to each client.
To sync Joplin exports that data to a sync target (which in your case is also on your computer) in a format that allows other clients to import it into their local data store and so keep in sync.