Many people get into the stock market to build generational wealth. And although nothing is guaranteed, the historic performance of the stock market suggests it is one of the best vehicles to compound returns over time.

There are a lot of different styles of investing. Some folks prefer to target a basket of growth stocks, knowing that some could do quite poorly or fail entirely, but those failures could be more than offset by massive successes.

A far simpler way of compounding wealth is through dividend stocks. Companies that choose to return capital to shareholders through a dividend instead of reinvesting it in the business tend to be safer, established companies with slow and steady growth. Therefore, dividend stocks can be a good option for risk-averse investors or those looking for a passive income stream instead of solely relying on capital gains.

Here's why Target (TGT 0.18%) and United Parcel Service (UPS 0.14%) stand out as my top two dividend stocks for building generational wealth.

Three people gather around a laptop and collaborate.

Image source: Getty Images.

Target stock has taken a beating

Target stock hit a fresh 52-week low on Friday. And if you take out the brief market collapse in spring 2020, Target is hovering right around a four-year low.

The retail space has been under a lot of pressure lately -- and for good reason. The reality is sinking in that interest rates could remain relatively high for longer than expected. What's more, average U.S. mortgage interest rates are now over 7%, the highest in over 20 years. 

When interest rates are low, the cost of money is cheap, and consumers have an easier time financing discretionary goods and services. But when interest rates are high, consumers are pressured to spend within their means, which isn't necessarily a bad thing in and of itself, but it does slow down the growth of the overall economy. And it's a major headwind for retailers like Target.

Target isn't a luxury store by any means. But it has a more discretionary product mix than, say, Walmart (WMT -0.08%) or Costco Wholesale (COST 1.01%). Walmart's business model centers around an efficient supply chain, ultra-high volume, and razor-thin margins to undercut the competition. But contrary to popular belief, Walmart's margins have been falling too. Not as dramatically as Target's, but they are still down big over the last decade and are now close to Costco levels.

TGT Operating Margin (TTM) Chart

TGT Operating Margin (TTM) data by YCharts.

On the last Target earnings call, the whole focus centered on the health of the consumer and the short-term outlook. Get too caught up in analyst questions and short-term Wall Street thinking, and you may have missed all of the impressive strides Taret is making with its loyalty program, managing its inventory, and improving its operations.

In June, Target raised its quarterly dividend to $1.10 per share, marking the Dividend King's 52nd consecutive year of dividend increases. Earnings of $4.40 per share in annual dividends comes out to a whopping 3.9% forward yield at Target stock's price of $112.60 per share at the time of this writing.

Target is going through a tough time. But the massive sell-off, paired with the brand power and dividend track record makes this stock a safe and potentially lucrative investment.

View UPS's slowdown within the context of its massive growth streak

Like Target, UPS is heavily dependent on the strength of the broader economy. Last quarter, it lowered its full-year revenue and operating-margin guidance to $93 billion and 11.8%, respectively. Here's a look at how those figures stack up to the company's performance over the last few years.

UPS Revenue (Annual) Chart

UPS Revenue (Annual) data by YCharts.

All told, not bad at all. Especially considering the torrid growth rate UPS was on. However, investors hate surprises. And the updated guidance provides exactly that, as UPS had forecast 2023 revenue of $97 billion and operating margins of 12.8% when it announced first-quarter earnings in April. 

Slowing growth, paired with the labor agreement reached with teamsters, is impacting UPS's short-term performance. However, these factors have little to do with the company's long-term potential.

With a company like UPS, it's important to zoom out and look at how the business is doing in real terms instead of focusing too much on year-over-year comparisons. This is a company that is bringing in a lot of profit, which has supported a hefty buyback program and substantial dividend raises.

In Q2, UPS reaffirmed plans to make dividend payments of around $5.4 billion and share repurchases of around $3 billion. There aren't too many industrial companies out there that are returning over $8 billion to shareholders in a single year. But UPS is able to do that because, despite slowing growth, its margins are still excellent, and it is a very well-run company. With a 4.1% dividend yield, UPS stock offers investors a sizable yield and the ability to invest in a top package-delivery company. 

Quality companies for a compelling value

When top-shelf stocks undergo massive sell-offs for factors largely outside of their control, that's usually a good time to buy. Target and UPS have looked like reasonable buys for some time now. But the sell-off just kicked into high gear. And now, both companies are looking downright cheap. 

Target has a 15.5 price-to-earnings (P/E) ratio compared to a five-year median P/E of 18.6. And that's even considering the fact that Target's earnings have been down. Meanwhile, UPS clocks in with just a 13.3 P/E ratio compared to a five-year median P/E of 19.6. Both stocks have valuations vastly below the average stock in the S&P 500 and yields far above the average stock in the S&P 500.

Of course, Target and UPS's growth prospects will be muted in the short term. However, both companies have competent management teams that focus on long-term growth by investing throughout the business cycle. That mentality should benefit investors and help lead to future growth even if it makes the short-term more painful.

Given the market position, yield, and valuation, Target and UPS have what it takes to build generational wealth for patient investors.