That's just the thing: even if a company like Apple might be inclined to ignore short-sighted shareholders, nearly always they don't have the institutional capacity to find good uses for cash. Look at companies like Google and Yahoo: they throw excess cash around like crazy, rolling the dice to hit something great. (Even Google's solid, cool projects like the driverless car are highly speculative.)
Everything Amazon does, by contrast, is very clearly focused on one clear goal: becoming the retailer of record. It is able, either by institutional constitution or the nature of its market, to make investments in itself that will clearly add to its bottom line, either one or five or ten years from now.