I've heard way too many people compare the stock market to a glorified, high-tech casino fueled by nothing more than thousands of well-dressed Ivy League hotshots throwing money around in the mythical land called Wall Street.

How much weight does this theory hold? Is the market truly a big gambling machine governed by Lady Luck?

The unfortunate answer for many of us can be a resounding yes. For the majority of stocks in the investment universe, market efficiency has provided the opportunity for no more than a mediocre return at best when compared to the underlying risk of holding that investment.

Shoulda, woulda, coulda
There will always be stocks that, viewed in hindsight, leave you kicking yourself for not partaking in what was such a blatant opportunity for success. Remember when eBay (Nasdaq: EBAY) and Yahoo! (Nasdaq: YHOO) were left for dead after the carnage of the dot-com bust? Or when Berkshire Hathaway (NYSE: BRK-A) (NYSE: BRK-B) was whittled down to scraps in 2000 after investors wrote off Warren Buffett as stodgy and behind the times? Each of these situations provided scenarios where the risk/reward trade-off didn't add up to more than fuzzy thinking, and provided investors the opportunity to cash in on a true market inefficiency.

For a much larger group of stocks, however, the forward-looking prospects are about as opaque as a Minneapolis windshield on a January morning. Think you know exactly what the next technological breakthrough is going to be? Think you know more than everyone else out there? You probably don't.

How does this relate to gambling? Take horse racing. The track typically takes around 20% of the amount wagered to cover the cost of the track and leave it with a respectable profit. If this sounds like a hefty ante-up fee, it is. In light of this, even those few individuals who possess the knowledge and skill to pick a winning horse are often left scratching their heads wondering why they're unable to turn their knack for ponies into a consistently profitable venture.

Look out, Danny Ocean
Surely though, there have to be a select handful of people who do in fact make horse racing their primary source of income. While few and far between, indeed, there are. How are they able to capitalize on a system that is so heavily stacked against them? Simple: In horse racing, the house takes only the 20% cut, leaving nobody but the players themselves to decide the payoff for each horse. Of course, once in a blue moon, the players on the whole will wildly misprice a horse's potential. It is then, and only then, that the successful gambler will make a move -- when a mispricing leaves the odds of success stacked heavily in the bettor's favor.

How about slot machines? I know, I know, the lights, bells and whistles surely provide hours of entertainment. But should you count on walking away with a thicker wallet? Most of us know the answer. The reason casinos like Wynn Resorts (Nasdaq: WYNN) and Las Vegas Sands (NYSE: LVS) stand to rake in the money from these machines is quite simple: The odds are in their favor, making it a mathematical certainty they'll come out ahead in due time. The winners in this case are never anyone but the luckiest of the bunch.

Wall Street? Preakness? Same difference.
Think of the stock market as the horse track -- there is no house-take other than transaction fees which, thank heavens, are far less than the 20% our friends at Churchill Downs (Nasdaq: CHDN) have to pay. The market, therefore, is the combined judgments of all its participants; everyone from you and me to Warren Buffett and the government of China, all trying to place what we think the correct value will be on our investments. If you're patient and don't try to swing at every pitch you see, once in a while you'll find a stock that's wildly mispriced, and the ones who bet heavily when these situations arise will be rewarded handsomely in the wake of everyone else's frustration, just as they are at the horse tracks.

Far too many of us, however, invest by taking the odds the rest of the market quotes us as if they came straight from the Bible. If you place your thought process square in line with the rest of the crowd, as the majority of bettors at the horse track do, you're setting yourself up to be at the whim of what we experience at the slot machines -- throwing out a Hail Mary in what isn't more than a hope for good luck.

While we may enjoy the thrill of the market the way we enjoy free cocktails from the casino, achieving stellar success demands being meticulously picky in what we choose to put our money in and having the patience of a stone while we wait for mispriced investments to show their face.

But hey, if you're still looking for a good time, by all means, roll those dice!

For related Foolishness:

Fool contributor Morgan Housel owns shares in Berkshire Hathaway, but he doesn't own shares of any of the other companies mentioned in this article. He appreciates your questions, comments, and complaints. eBay is a Stock Advisor recommendation. The Motley Fool owns shares of Berkshire Hathaway, which is also a Stock Advisor and Inside Value recommendation. The Fool's disclosure policy never gambles with your time.