The Social Security payments for retirement are based on 35 years of indexed earnings. If you have less than 35 years of earnings, then your record will have zeros. If you have more than 35 years, the lowest indexed amounts will be dropped. If someone is receiving benefits but is also working, then the benefits are re-calculated (and thus increased) if one of the 35 previous "highest" years can be replaced with a newer "top-35" year. (There is a time-delay in this recalculation; it does not happen as soon as the year ends)
The 40 Quarters requirement is the minimum number of quarters to be eligible for retirement benefits. Once you reach 40 Quarters, the top 35 years' earnings calculation is used.
The Social Security Administration even has a table (Benefit Calculation Examples for Workers Retiring in 2015) to explain this. The SSA also indexes your earnings so that it reflects changes in the standard of living. You can see the indexing factors.
You can use, and should use the My Social Security Account to check your own estimates and to:
- Keep track of your earnings and verify them every year;
- Get an estimate of your future benefits if you are still working;
- Get a letter with proof of your benefits if you currently receive them; and
- Manage your benefits