I've heard that AOA is a definite help in getting top residency positions in competitive specialties. However, some schools don't have it (HMS being one of them). The specific criteria for election are set by the school; however, here's what the national AOA says:
Election shall be limited to those candidates whose scholastic qualifications place them in the upper twenty-five percent of their class. The total number elected, however, shall not exceed one-sixth of the total number in that class expected to graduate. Not more than one-quarter of the quota (25 percent) may be elected prior to the final year of the medical course.
Each chapter has the responsibility of defining its own method of election, including determination of those eligible to vote. Notification of election to membership is made to students in the Fall.
Scholastic achievement should be the primary but not the exclusive basis for election of a student. In addition to the academic record, personal characteristics may be considered to the extent defined by the chapter: leadership, fairness in dealing with colleagues, compassion, integrity, and service to the school and community at large may be considered. Each chapter should define its own weighting system for such criteria as grades, faculty, and other comments, and personal attributes and attainments.