In most states the employer or person must get consent from the person they are conducting a background check on before the background check can legally be performed.
To get a good background check done you need some personal information from the person anyway.
So the person would usually know that they are getting a background check done on them and when you apply for a job or apartment or house to rent then you will be told that a background check will be done before the apartment or house is rented out to you or you get the job.
A background check in today's day and age is very routine and if you have done nothing wrong then there's nothing you need to worry about if you do have a background check run on you.
When you apply for a job or apartment you can always refuse to have the background check done but you'll usually also be denied the approval for the apartment or not get the job.