When companies repurchase their own stock (commonly known as buybacks) it reduces the number of shares available to other investors. By limiting supply in this way the basic laws of economics suggest that the price of the remaining stock increases. So buybacks are a means of supporting the share price as an alternative to paying dividends by reducing the number of shares available to the investment community. Companies may decide that they can offer existing shareholders the best return by utilising spare cash in this way.
Buybacks are the converse of issuing new shares for sale under a secondary offering which often dilute existing shareholders by creating more shares available. These are designed to raise cash for a project or acquisition, a buyback does the reverse, the company spends cash on shares and may hold them in Treasury or cancel them. Either way they become unavailable to existing or new shareholders.