When a company calculates its earnings over a certain period of time, it divides its profits by the number of outstanding shares. However, companies' outstanding shares can change over time as a result of newly issued shares, repurchased shares, exercised employee stock options, or several other reasons.
To most accurately reflect its earnings per share, we need to know how many shares there were during the entire period -- not just at the end. To do this, we need to calculate a weighted average of the company's outstanding shares over the time period.