That's actually wrong. Under FOIA you can only get someone's name and service dates. Medals, awards, discharge, and all documents can not be given by FOIA.
This is how it works. Your employer must do 2 things in order to get your military records. First, they must have military records in wording on their background check form. If the background check does not state "military records" your employer can not legally ask for a copy of them. If the background check does include military records and you sign it your employer must ask you to fill out form SF-180. This is a form to request your military records.
The process has to be done in that way because a background check only includes public information. So criminal and civil issues will be listed and findable. Military records are not public information so an employer can not pull them without your consent. If an employer tries to pull them without your consent using FOIA all they can get is your name and service dates. Again, discharge, medals, and all military documents pertaining to you are not covered by FOIA.
So if you're trying to get a job read the background check before you sign it. As long as it does not state "military records" they legally can not even ask for them. If it does state "military records" they can ask for them but you still have to consent to them oulki g your records by filling out form SF-180.