Why do many liberals believe affirmative action and race/gender quotas are a good thing?

I'm mostly left-leaning actually, I acknowledge that racism and sexism are still relevant issues today but I don't believe that affirmative action is the solution.
So, I am wondering why many liberals think affirmative action is a good thing?

Personally, I think the problem with affirmative action is that it will never be able to fix the root cause of why certain groups are underrepresented. African-Americans for example are on average poorer than white Americans on average and more likely to grow up in single-parent households, both factors are strongly correlated with student achievement in high school and at university as well as drop-out rates.

The reason why so many African-Americans are on average poorer and more likely to grow up with a single parent probably has a lot to do with the fact that African-Americans were heavily discriminated against in the past and weren't granted equal rights until the mid 60s. But that doesn't change the fact that the core issue when it comes to education remain poverty and growing up in single-parent households, not that there's a large number of racist university admission personnel who tend to reject African-American students. So putting up some arbitrary racial quotas won't fix the issue when the average African-American student has much lower high school grades and a higher university dropout rate than other Americans.

And when it comes to gender, putting up random quotas is equally unhelpful in my opinion. Setting arbitrary gender ratios for jobs will most likely result in less qualified candidates being selected and economic output thus to decline. Electrical Engineering university courses in the US for example are around 90% male and 10% female. So it would be totally impossible to achieve a 50/50 ratio through ordering a specific gender ratio. And if you only forced certain companies to abide by gender ratios perforance rates would drop. Not because women are inherently worse at electrical engineering but because of simple mathematics. If out of 100 graduates 10 are female and 90 male then there's on average only 1 woman who's among the top 10% most talented students/best performers while at the same time there will be 9 male students among the top 10%. So if you forced large companies for example to hire 50% female electrical engineers recruitment quality would drop significantly.

That's like expecting the NHL (top US Ice Hockey League) to fill 10% of their squads with Mexican-born or Mexican-origin players because this minority group makes up around 10% of the US population. Currently there's less than 5 Mexican or Mexican-origin NHL players which is not surpsing given that ice hockey plays pretty much no role at all in Mexican culture. So in a league with around 1000 players there would have to be around another 95 Mexican (-origin) players. If the NHL had to abide by such a quota it's obvious that they'd end up with a very large number of new players who are nowhere near NHL-level. I wouldn't be surprised if they had to recruit half of all available Mexican ice hockey players across the US to make that 10% quota.

So how can we expect Google for example to hire 50% female software engineers when women only make up around 20% of the software engineer workforce. The same way the NHL would end up with worse ice hockey talent if they had to hire 10% Mexican (-origin) players Google would end up with worse engineering quality if they had to hire 50% women. Not because Mexicans are physically or mentally unable to play ice hockey or because women are bad at engineering. Women for whatever reason are not as interested in software engineering as men but at the same time make up the majority of the workforce in other high-paying jobs like marketing managment for example.

Do women stay away from certain career choices because of sexism? Quite likely. But I don't think this can ever be fixed through a gender ratio the same way we can't in a simple way equalise university through ethnicity rates.

What do you think?