Companies buy back shares when they think that their stock is undervalued. This year, buybacks have been climbing at a record pace.