Nobody knows. It’s one of life’s mysteries. 
20 CFR 404.201 et. seq. discusses PIA. PIA is the first step in finding your monthly social security benefit amount payable to you and to members of your family. (BTW, I’m using the same words that the regs use. When Carter was President he mandated that the language in the regs be altered so that a sixth grader can use it; hence the use of “you,” “your,” “we,” etc.) If you retire at full retirement age (which, I believe is 66+ now - it has gone up incrementally for everybody born after the year 1937 until it maxes out at 67), your monthly benefit is equal to your PIA. In all other situations, it does not. Benefits payable to members of your family are a specified percentage of your PIA. The PIA automatically increases to keep it up to date with cost of living (COLA). That’s what the reg says, but this year there was no increase.
If after age 1978 you attain age 62, or become disabled or die before age 62, it is computed under the “average-indexed-montghly-earnings” method. Since this applies to most people, I will limit my discussion to this proviso.
Three major steps are used in computing PIA under the above method. First, your “average indexed monthly earnings” (AIME) are calculated. Earnings before 1951 are not used. All years after 1950 up to, but not including, the year you become entitled to old-age or disability insurance benefits are used in computing the base years. The year of entitlement and following years may be used in a recomputation if it would result in a higher PIA.
Before computing AIME, the “average of the total wages” of all workers for each year from 1951 until the second year before you become eligible are computed. These figures are shown at tables at 20 CFR 404.211. The bases for the computations are described at 404.211. Suffice it to say that for the years after 1978, the W-2 forms are used.
The first step in indexing your earnings is to find the relationship between the average wage of all workers in your computation base years and the average wage of all workers in your “indexing year.” As a general rule, that year is the second year before you reach 62, become disabled, or die before reaching 62
To find that relationship, the average wages for your indexing year is divided by the average wages for each year beginning with 1951 and ending with your indexing year. Those quotients are used to index your earnings for the next step.
The second step is to multiply the actual year-by-year dollar amounts of your earnings (up to the maximum amount credible) by the above quotients. (The quotient for your indexing year is 1, which means that the earnings in that year - and all future years - are used in the actual dollar amount.)
The above is the general method, but there are many variations which I am not going to go into. Thank God for computers.