Near term, buy backs stabilize your share price. Share price is a major driver of many incentives inside Apple as well as perceptions without.
Long term, Apple is betting their shares will increase in value.
Investors are not rational or accurate in their assessments of a company’s performance (why market “expectations” is the bar, not performance), stock markets are not perfect information systems, and most finance professionals regard stock price as the final say on a company’s performance & value.
Put together, this means a company’s best defense (when as successful as Apple) against being under-priced in the stock market is to buy back their own stock. To do that, you need a massive cash war chest or sources of cash like PE/hedge funds/etc. so far only companies with the first option live very long.