A man waits with shopping outside a store on Oxford Street in central London.

FORTUNE — To all the ladies out there wondering, yes, that man in the cubicle next door or the guy at the grocery store does indeed have a better wardrobe than you.

And that shouldn’t come as much of a surprise. For the past few years, the gentleman shopper has been flexing his fashion purchasing power. In 2013, menswear sales grew by just under 5% worldwide, slightly outpacing womenswear, according to a report released this week by Euromonitor. That trend held true in some of the world’s biggest markets — in the U.S., U.K., and Germany, sales-growth of men’s apparel topped women’s.

“Men’s — historically — doesn’t move as much, period. It’s more resilient in a down time since they’re more brand loyal,” says Eric Beder, managing director at Brean Capital. That means a man devoted to Ralph Lauren RL will buy a polo shirt, recession or not.

But there is more than just market variables at play. The trend has actually been going on for some time — global menswear sales have skyrocketed 70% since 1998; U.S. menswear sales have spiked 16% since then.

MORE: Why New York’s hardware scene is booming

The trend’s origins are hard to identify, but Michael Londrigan, dean of academic affairs at LIM College and author of Menswear: Business to Style, points to the dot-com boom era, when techie workplaces embraced an unbuttoned vibe. The era inspired a loosening of men’s wardrobe rules and subsequently opened up their wallets, Londrigan says. “For so long, you wore a suit and tie, and all of the sudden guys are saying, ‘I don’t have to do that.’ But then they look in their wardrobe and realize they don’t have anything to wear.” So, they went shopping for laid-back workplace attire.

Suit sales’ growth shrank by 4.1% between 1999 and 2000, and then dipped 21.1% from 2000 to 2001 in the U.S., outpacing the global decline in sales, according to Euromonitor. Meanwhile, men’s super-premium denim sales shot up 0.4% and 6.8% over those same years and increased nearly 200% from 1999 to 2008.

Sales overall slumped during the recession — menswear shrank 6.2% in the U.S. and 4.2% globally from 2008 to 2009. But the downturn had a silver lining: It all but eliminated the downsides of the newly relaxed workplace wardrobe — what Londrigan describes as investment bankers trying to negotiate deals while wearing khakis and a polo.

Casual is still king, but it now has a more refined air. “There’s a movement back towards dress-up, but not to a three-piece suit,” Londrigan says.

“Men are wearing dressy as casual,” says Marshal Cohen, a chief industry analyst at The NPD Group. Picture a suit jacket paired with a button-down and jeans. “They think, ‘I’m going to wear a new suit by day and by night,'” he says. “The suit is more expensive than the casual sportswear that they were buying before, so that drives the average price up.”

Suit sales grew nearly 10% in the U.S. from 2009 to 2013, totaling $2.3 billion last year.

In general, “men are taking greater care in their grooming and appearance,” says Ashma Kunde, global apparel and footwear analyst for Euromonitor.

For that sharper style, you can thank millennial and middle-age men.

Millennials — who grew into their discretionary income and purchasing power soon after the recession — construct their identity through what they wear, not by what they use, says Cohen of NPD. The previous X and Y generations defined themselves by the electronics they owned, but now that many consumers are on the same gadget playing field, the younger generation is spending more on what they look like, he says. Plus, millennials’ penchant for social media and those shameless selfies means that they live a more public life.

MORE: IBM’s double dilemma

“They’ve grown up like they’re on a stage at all times,” says Ben Lerer, co-founder and CEO of Thrillist Media Group, which operates a members-only online shopping club called JackThreads. “That leads to being more thoughtful about the way you look and more comfortable with the idea of shopping for yourself,” he says.

As millennials enter the workplace, their tech skills are presenting a threat to more experienced male workers, who want to come across as just as hip — and therefore as technologically savvy — as their younger counterparts.

“Men in their 50s and 60s, they think to compete and remain in the workplace, they think they have to look younger,” says Jay Yoo, assistant professor of family and consumer sciences at Baylor University.

So the more mature shopper needs a more extensive, and therefore more expensive, wardrobe that goes beyond the uniform charcoal suits he wore a decade ago. “It’s a cultural change of men adopting a more casual [wardrobe], but it also represents significant business growth,” Yoo says.

Men have also built up a larger post-recession demand for clothing than women. When shopping tapered off during the recession, men simply wore what they had on hand for longer periods. And because men typically have a smaller wardrobe than women, they have fewer items in rotation, which means their clothes likely suffered some wear and tear. “How long can a pair of jeans last? How long can you wear that button-down,” Cohen says. “After the recession, men were hungrier for a new wardrobe.”

The growth in menswear is certainly not lost on retailers — online and brick-and-mortar alike.

Department stores have expanded and upgraded their men’s sections, says Kunde of Euromonitor. Lord & Taylor, for instance, recently announced that it was doubling the space dedicated to menswear at its flagship store in New York City. Saks Fifth Avenue announced last year that it was expanding its namesake menswear line due to popular demand and was opening in-store shops devoted exclusively to the brand. And Bergdorf Goodman said it would add a luxury accessories section to its men’s store.

MORE: Bitcoin ‘vault’ company raises $20 million from big-name investors

And e-commerce is cashing in on the trend too. Across the web, online retailers like Bonobos, Frank & Oak, Combatant Gentleman, Alton Lane, and JackThreads are mixing fashion products with content to ease men’s shopping experience and advise them on their expanding wardrobe.

“There are these new brands that are emerging that understand this socially minded consumer,” says Lerer. “There’s an opportunity for guys to not shop at stodgy, traditional retailers that have a negative connotation for being embarrassing places to shop with your mother.”

And as stores and online brands offer men more products, guys are availing themselves of it, says Londrigan. “So the trend of growth in menswear becomes a self-fulfilling prophecy.”