Public Companies many times buyback shares from secondary market.This is done when the company has extra cash and it eventually increases the stake of the existing shareholders. This is considered positive indication for any company.
Now since the shares are bought from the money from the company and not the shareholders, the bought back shares are now not of any value. So these shares are kept as a treasury stock on the balance sheet if not striked off.
The purpose of keeping the bought back stocks on the balance sheet is that in case the company want to issue shares again, they can use these treasury shares. Otherwise the directors will have to sign an MOU and issue new shares which is again a tedious process.