Buying back shares doesn't raise the stock price because it doesn't change the underlying fundamentals. If the stock goes up after a buyback, it only stays up if there was a reason other than a share buyback.
If you yourself had a a market cap of $25 including the $5 in your wallet, giving away that $5 would lower you market cap to $20.