Some companies, like Apple, simply make so much money that it's hard to invest it all in new business. A large amount of the money is also overseas so there are tax implications during repatriation. Many investors also prefer that a company like Apple buy back shares rather than pay out a dividend so the investors can better control their own tax situation. Given how the low the interest rates were until recently, it also made sense for a company to borrow the money to buy back the shares using their cash as collateral.
Keep in mind that regardless of interest rates, sitting on cash for interest is not what investors want long term. Investors can do that themselves without taking on the equity risk.