Deleting mails from iPhone will remove the mail from the device ( iPhone ) , the mails will not sync when the same gmail address is used and signed in with its password either from Mac / iPhone or other device , when you delete mails from Mac they will move in trash folder of gmail account .
Your can't compare with same Apple ID and password say example1@icloud.com in which pure syncing is occurred .
Deleting mail account from Mac system preferences > internet account has no connection with it , even you again add the accounts .
Just an example if you go to cybercafe where people come and browse for a time and pay to the owner for it and you sign in with your gmail account with credentials from their computer , and you delete mails from there it will be deleted from their device and gmail server and move to trash , once you go to your Mac that is in another location and on the other network , the mails will not be deleted from Mac , the reason they are not synced and it will never happen .
Say your apple id is set with gmail services the devices ( iPhone / Mac ) are synced on the same network still deleting of mails will move them to respective devices .