We usually think of while to mean “during the time that,” but it can be used to mean “whereas.”
In the former case, while is not preceded by a comma.
In the latter case, while must be preceded by a comma.
Example: I can’t talk on the phone while my little sister is screaming.
Example: The Pacific Ocean is often calm, while the Atlantic Ocean is rough.
Some purists and copyeditors tend to frown on the use of while to mean whereas because the meaning depends upon the comma, and points of punctuation have a habit of not being where they should be.
If you choose to use while to mean whereas, it’s important to be clear about your meaning.