Whereas is a conjunction used to contrast two facts, meaning roughly while or in contrast to the fact that. My brother is tall, whereas I am short. It simply points out that the two sides differ. In legal documents it can introduce background statements, but everyday use is just a simple contrast marker between two facts.
Whereas in two sentences
She loves big cities, whereas her husband prefers the countryside. The word links two complete facts and highlights that they differ, almost like drawing a line between them.
You eat a huge plate of food for lunch, whereas I have just a sandwich. Here the first fact sets the scene, and whereas introduces the second fact that contrasts with it.
Whereas and while
Whereas and while mean the same thing in sentences that contrast two facts, but while has an extra meaning that whereas does not. While can also talk about time, as in Wait while I find my keys. Whereas can never do that, so it always signals a difference between two ideas.