A couple of years ago I had to get a new CAC Card type retired ID because of a change over in ID cards required to get on military bases. And like you, it had a unique DoD ID number that replaced the SSN as well as a chip, barcode and magnetic strip. With it, when I go through the base gate the guard scans the barcode and it gives him a code that verifies the validity of the card and my authorization for access.
I haven’t been on a military base/post in over 20 years. Do they still issue window decals for cars, or do they just check your ID?