Dividends are not actually the only way to return money to shareholders.
Due to the tax situation in the US, it's more efficient to just buy back your own stock (something Apple's been doing a lot lately). Those function more-or-less-the-same as dividends in terms of returning the profit the company has made back to its owners (so they can invest somewhere else, presumably).