You have to be in the top 1/6 of your class to get into AOA...'tis part of the rules. Other factors (activities, volunteerism, etc) are school dependent. Also, determining the top 1/6 of the class is school dependent. My school, which is H/P/F in the first two years and H/HP/P/LP/F in the clinical years uses USMLE Step 1 scores and number of honors in third year to make the big decision.
Regardless of how your school does it, AOA is generally regarded as an academic honor (much like Phi Beta Kappa in undergrad) and seen as such by residency directors. It tells them that you are among the best your school has to offer.
As far as being "needed" for competitive residencies, I would disagree. It certainly helps (and is a reflection of good grades, so the two are a bit redundant). However, LOR play at least as big and perhaps bigger role.
Hope this helps.