What does System Preferences > iCloud > Mail do?
This is the iCloud Mail service. Turning it on provides the iCloud mail account for Mail.app to use, nothing more. It is basically an automated method of entering the iCloud mail server information into Mail.app to configure your @icloud.com email account, per this Apple KB article:


iCloud: Mail server information


It does not sync other accounts in any way - settings or emails of other accounts are not affected by this setting, just your @icloud.com or @me.com account.



You can read more about iCloud Mail at this Apple KB article:


iCloud: Mail overview