The device to be disconnected is an iPhone , if Apple ID is signed out from Mac system preferences > iCloud the Mac will be signed out from iCloud account and not an iPhone .
It’s a syncing process , say if there are many apple devices like iPhones , few Macs in an office and all are signed in with same Apple ID and password , a person signs out from Mac so all people who are synced with Mac will get signed out from their devices .
Suppose it would have happened , then any person can give command to sign out from his device , then all the devices will be disconnected and signed out from their Apple ID account , and it’s like controlling the devices .
In very short Apple ID sign out process is to sign out from an individual device .
Method to sign in with same apple id and password in Mac and iPhone .
A message will appear in iPhone your Apple ID is being used to sign in to a Mac book near …location . Two options will be shown allow , do not allow so click on allow .
An apple verification code will appear on iPhone , enter this verification code on your Mac book , click on continue .
In your Mac it will prompt to enter admin password , so enter it and click on ok , the circle will rotate in Apple ID field , wait for a while a window will appear the boxes for use iCloud for your documents and data and use find my Mac boxes are checked by default so click on next and click on allow .
See the articles Sign out of iCloud on your iPhone, iPad, iPod touch, Apple TV, or Mac - Apple Support
Sign in with your Apple ID - Apple Support
The iCloud tabs will never re-sync .