Taht still doesn't answered how employers keeping track of the ethnicities of employees helps against discrimination in any way.
To me that's exactly what helps lead to discrimination versus not knowing ethnicities and treating employees as anonymized numbers which would be fair to everyone.
The history of racism in the US is long and complex. In essence we keep track of this sort of thing to try to prevent ongoing systemic racism. "You can't fix what you don't measure" and all that. It also doesn't need to be systemic racism per se. People tend to hire people like them due to unconscious biases so if your company is mostly "X" there are is a good chance it will continue hiring "X".
To me that's exactly what helps lead to discrimination versus not knowing ethnicities and treating employees as anonymized numbers which would be fair to everyone.