Stock buybacks have surged in popularity over the last 10 years, and retail investors can reap a number of stock buyback benefits. But it's important to understand how buybacks work before determining if they're good for your portfolio.

Here's everything you need to know about stock buybacks…

How Does a Stock Buyback Work?

A stock buyback is when a company literally buys back shares from shareholders. A stock buyback reduces the number of shares outstanding.

Because the company is publicly owned and traded, it repurchases the stock so it can have better control over voting rights.

There are two types of buybacks: tender offer and open market.

A tender-offer buyback is when a company makes a deal to buy shareholders' shares. If the shareholders accept, they negotiate the number of shares they'll give – or "tender" – and the price. This type of stock buyback benefits investors because the company always buys the shares at a premium to the current stock price.

The second and simpler type is an open-market buyback. That's when a company acts like any other individual investor. It buys shares on the stock market at the market price. Open-market buybacks are large-scale yet more efficient because they don't involve bartering with shareholders over the price.

Both types of stock buybacks have surged in popularity recently. The Academic-Industry Research Network reported more than $6.9 trillion has gone into stock buybacks since 2004.

Last month, Wal-Mart Stores Inc. (NYSE: WMT) and Hewlett-Packard Co. (NYSE: HPQ) announced $20 billion and $3 billion buyback programs, respectively.

But the excess number of buybacks is becoming a problem. Many large corporations are issuing buybacks to cover up their financial troubles.

"I'm not all that sure that they aren't way out of control," said Money Morning Capital Wave Strategist Shah Gilani. "Buybacks are the biggest part of what we now call financial engineering."

Money Morning Capital Wave Strategist Shah Gilani reveals more about the often insidious nature of stock buybacks. Then he explains how investors can play buybacks to turn a profit…

Wal-Mart is the perfect example of financial engineering. On Oct. 14, WMT stock plunged 10% after the retail giant slashed its sales forecast for 2015. After shedding $20 billion in market value that day, Wal-Mart tried to soften the blow by announcing its buyback program.

While some stock buybacks are just financial engineering tactics, you can still bank profits from them if you make the right moves.

Here's how a stock buyback benefits retail investors like you and me…