Originally, in the 1960s, affirmative action was intended to counteract blatant discrimination against minorities and women in areas like jobs, higher education, and voting, and to "level the playing field" so that qualified people were not discriminated against solely because of race, ethnicity, or gender.
Unfortunately, in the last half-century or so, the original intent has been almost completely turned around by things like New Haven's original action in the Ricci case, which assume discrimination where none occurred. It's often used to give less-qualified people an advantage over more-qualified people, and assumes that because someone is a minority or a woman, they must have been at a disadvantage, when that's not always the case.
In fact I would argue that as applied today, the principles of affirmative action actually work to the detriment of the people they're supposed to help, since the result is often a perception that a black/Latino/woman/disabled person only got where they are because of affirmative action, and not because they might be the best qualified for the job.