I believe the answer is: The number of fiscal quarters the employee worked during his or her lifetime and the amount of money the employee contributed to the Social Security Trust Fund.
The amount in Social security trust fund is being added through direct deduction of the employee's base salary before the pension time. Which mean that as the employee use less of their money for their consumption during productive years, the amount of money that they would receive after retiring would be increased.