Many investors probably think of Fitbit (FIT) as the most straightforward way to invest in the growing wearables market. However, shares of Fitbit have fallen more than 70% over the past 12 months due to concerns about slowing sales, declining margins, and rising competitors.

Yet during that same period, Garmin (GRMN -0.85%) -- the unloved GPS and wearables maker, which has been losing relevance to smartphones and fitness trackers -- rallied 26% to a 52-week high. The stock also surged 11% after its second quarter earnings report revealed soaring demand for its wearable devices.

Let's take a closer look at those results, and see why Garmin could be a much better wearables play than Fitbit in the long run.

Garmin's wearable devices. Image source: Garmin.

How great were Garmin's earnings?

Garmin's revenue rose 5% annually to $811.6 million and beat estimates by $48.6 million. Fitness device revenue rose 34% to $212.9 million, while outdoor device revenue jumped 23% to $133.1 million. Both categories were boosted by strong demand for the company's Forerunner 735XT, Vivosmart HR+, and Vivomove devices during the quarter.

The Forerunner 735XT is a GPS running watch which costs $450. Garmin sells a wide range of cheaper Forerunner devices which cost between $140 and $400, along with a high-end device, the Forerunner 920XT, which also costs $450. The Vivosmart HR+ is a $220 heart rate tracking device similar to Fitbit's Charge HR, and the Vivomove is a $150 fitness tracker that looks like a classic watch.

Garmin sells 27 types of wearable devices for all kinds of mainstream and niche outdoor needs. The Approach S6, for example, is a wearable device for golf players that displays course maps and measures swing speed and strength. The Garmin Swim is a watch that records distance, pace, stroke count, and stroke type for swimmers. This scattergun strategy helps it reach more niches than Fitbit, which has a narrower portfolio of eight wearable devices.

The Garmin Swim. Image source: Garmin.

Garmin's marine revenue rose 8% to $111.6 million, while aviation revenue rose 6% to $108.3 million -- indicating that its GPS trackers were still widely used in boats and planes. Auto revenue fell 18% to $245.7 million, but that decline was expected due to smartphones replacing dedicated GPS devices in cars.

Gross margin expanded 280 basis points annually to 57%, and its GAAP EPS rose 18% to $0.85. On a pro forma basis, which excludes the effects of foreign currency losses, earnings rose 21% to $0.87 per share, beating estimates by $0.20. Garmin previously expected its full-year revenue to stay flat at $2.82 billion, but it now forecasts 3% growth to about $2.9 billion. Pro forma earnings are also expected to rise by a penny to $2.50, compared to its prior forecast of $2.25.

Wil Garmin's gain be Fitbit's pain?

Garmin seems to be stealing niche markets from Fitbit, which only categorizes its devices as "everyday" (Zip, One, Flex, Charge, Alta), "active" (Charge HR, Blaze), or "performance" (Surge) ones. These devices are fine for walking, running, and hiking, but they probably aren't ideal for the swimmers and golfers. Hardcore athletes might also prefer the more advanced running features of the Forerunner series over multi-function devices like the Alta and Blaze.

However, Garmin still lags far behind Fitbit in the wearables market. IDC reports that Garmin's worldwide wearables shipments rose 27.8% annually to about 900,000 units in the first quarter of 2016, which made it the fourth largest player in the world with a 4.6% market share. Fitbit led the market with a 24.5% share, followed by Xiaomi at 19% and Apple (AAPL -1.22%) at 7.5%. Fitbit, Xiaomi, and Garmin's market shares all notably declined year-over-year due to the expansion of the wearables market.

Why Garmin could be a better investment

Those figures indicate that it would be premature to call Garmin a "Fitbit killer". Both stocks have comparable P/E ratios -- Garmin at 21 and Fitbit at 24 -- but I believe that the Garmin could be a better investment for three simple reasons.

First, Garmin's portfolio is much more diversified than Fitbit's. Second, it doesn't need to live up to extremely high expectations -- Garmin just has to post low single-digit sales growth this year to please analysts, but Fitbit has to post nearly 40% growth. If Fitbit misses that mark, its stock could fall even further. Lastly, Garmin pays a hefty forward annual dividend yield of 3.9%, while Fitbit pays nothing.

Looking ahead, Garmin simply needs to grow its niche in sports performance devices, while Fitbit must prove that it can maintain its lead in the wearables market against cheap fitness trackers on one side and full-featured smartwatches on the other. Faced with that choice, I'd prefer owning shares of the overlooked underdog than the closely scrutinized market leader.