Home Depot (NYSE:HD) has a huge appetite for its own stock, even as the shares push to new highs. The retailer spent $3.5 billion on buybacks in the first half of the year and is targeting another $3.5 billion of stock spending through December. 

That $7 billion bet makes stock repurchases the largest piece of Home Depot's capital spending plan, bigger than dividends and capital improvements combined. But does it make sense at a time when shares are near their record high? Let's take a closer look at what has become one of the stock market's biggest repurchasing plans.

Where it comes from and where it goes
Home Depot obtains the funds for its buybacks from two sources: operating cash flow and debt. Both channels are absolutely gushing cash at the moment. Operating cash is up as sales growth and profitability spike higher. And debt levels are rising as Home Depot takes advantage of historically low interest rates.

HD Cash from Operations (Annual) Chart

HD Cash from Operations (Annual) data by YCharts.

Taking 2013 as an example, the company generated $8 billion in cash (10% more than the prior year) while signing on for $4 billion of new debt. After reinvesting nearly $1.4 billion from that $12 billion bounty back into the business, the remaining cash was sent to shareholders, largely in the form of stock buybacks.

The reason for the heavy skew toward stock spending is simple: Home Depot's management has targeted a conservative, but substantial, 50% dividend payout ratio. After sending half of its earnings to investors as dividends, all the remaining cash is slated for share repurchases.

Importantly, Home Depot hasn't skimped on business investments to fund these buybacks. Capital expenditures were $1.4 billion last year, $1.3 billion in 2012, and $1.2 billion in 2011. The company plans to spend $1.5 billion in 2014.

The value for shareholders
How do investors benefit from this stock spending? With shares up almost 300% in five years, it's hard to argue that buybacks have been a poor use of cash. But recent purchases have also worked out for shareholders even when funded by new debt. 

For example, the after-tax cost of Home Depot's latest long-term debt has been roughly 2%, and so it made a lot of fiscal sense for management to lean on that source. Retiring shares cost the company 2.3% in dividend yield with debt that cost just 2% in interest.

Shareholders are also getting higher proportional ownership in their company as Home Depot knocks down its outstanding share count. It is lower by 15% over the last five years, which is giving per-share earnings growth a nice shot in the arm. Last quarter was another example of that math at work: Net income rose an impressive 14% to $2 billion, but earnings per share leaped higher by 22% because those earnings had to be spread out over fewer shares.

The takeaway
As big as it is, Home Depot's stock repurchase program has been a solid use of cash, benefiting investors in important ways. You could argue the company should start directing more capital toward dividends, maybe by boosting its payout ratio to something closer to 60% of earnings. But management has been a good steward of shareholders' capital, including through stock buybacks.

Demitrios Kalogeropoulos has no position in any stocks mentioned. The Motley Fool recommends Home Depot. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.