They're investing in themselves literally.
TL

R:
it helps raise the price per share and they could sell those same shares later on for a huge profit.
There's no way someone could go through all the ins and outs in a single post that wouldn't be a snoozer to most but here's a quick attempt.
Every company traded has a certain amount of shares that are traded based upon market valuation, perceived worth, and a companies future progress...these are only some of the factors that go into determining the price per share for any company. Stocks can rise or fall based upon a lot of factors.
If you grasp that then...
After a company is listed on the stock exchange with X amount of shares a company can create and or sell shares as well as reduce the shares...this is truly oversimplification here and parts of this paragraph have pages upon pages of explanation on sites like investopedia but basically to cut to the chase when a company buys back its own shares it's at least in this case two fold, it helps raise the price per share and they could sell those same shares later on for a huge profit and depending on some loopholes (such as buy in one country, sell in another? Guessing here) may have some significant tax breaks associated.
Anytime a company does a buy back its great for investors like you or I and it also boosts investors confidence as any company that does one is basically saying we believe at these prices it's a steal.
I've personally made six figures with Apple in four years with an investment less than that of an annual wage of someone making minimum wage.
Investopedia is a good place to start learning but there's better places than this for stock talk.