Welcome to Nikonians! Aperture priority mode is an "Auto Mode". Here are two examples where Exposure Compensation is used to adjust for ambient conditions. When you subject is on a stage with black curtains in the background the matrix meter can easily be fooled into over exposing your subject because of the dark background. Dialing in some negative exposure compensation will skew the meter to increase the shutter speed (in A exposure mode) resulting in your subject being correctly exposed.
With back lighted white curtains in the background the matrix meter will be fooled into under exposing your subject. Adding some positive exposure compensation will skew the meter to use a slower shutter speed (again in A exposure mode) to adjust for the under exposure, resulting in your subject being correctly exposed.
When the foreground or background is significantly brighter or darker than your subject and you are using P, S, or A exposure modes, using Exposure Compensation allows you to compensate or adjust the exposure to fit the condition. Good Luck and Enjoy your Nikons!