Exposure compensation is one of those camera controls that looks simple because it is simple.
The useful part is understanding when to use it.
Your camera's meter is trying to make an educated guess about brightness. It does not know what the subject is supposed to look like. It just sees reflected light and tries to turn that into an exposure.
Sometimes that guess is wrong.
Why the Meter Gets Fooled
A mostly white scene can make the camera underexpose because the meter is trying to pull all that brightness toward middle gray.
A mostly dark scene can do the opposite.
Snow, beaches, black cars, dark rooms and backlit subjects can all confuse the meter.
The camera is not broken. It is doing exactly what it was designed to do.
Compensation Is the Correction
If the camera is consistently making the scene too dark, add positive exposure compensation.
If it is making the scene too bright, use negative compensation.
The exact amount depends on the scene. There is no magical setting that works everywhere.
Learn to Watch the Histogram
The preview on the LCD is useful, but it can lie because screen brightness and ambient light affect what you see.
The histogram gives you a better diagnostic view.
For high contrast scenes, I am usually paying particular attention to the highlights. Recovering a slightly dark area is often easier than recovering a completely blown highlight.
What Actually Matters
Do not treat exposure compensation as a beginner feature.
It is a speed tool.
Once you understand how your camera's meter behaves, compensation becomes one of the fastest ways to tell the camera, "I know what you think. Do this instead."
That is much faster than pretending the meter is always right.