Walk through a gate in a wooden fence in the middle of the Pimlico racetrack infield at the Preakness, and the world changes.

On one side, bikini tops and cutoffs. Loud pop music and beach volleyball. Sandwiches from home and bottomless mugs of beer. Big-screen videos for watching the race.

On the other, designer dresses and fabulous hats. Soft jazz and complimentary makeovers at a cosmetics booth. A buffet of beef tenderloin and crabcakes, washed down with seven kinds of wine and single-malt scotch. Seats along the finish line.

It’s no surprise that our society is split by class and caste. But it’s rare to see the divisions so clearly on display in such a small space as they are at the Preakness, held Saturday for the 136th time.

“This is the haves and the have-nots,” said David White, 64, a consultant from Finksburg, Md., as he strolled among the tents in the Corporate Village. Seats are $575 apiece in that part of the infield, the grassy expanse enclosed by the track.

Gesturing to the poor man’s side of the infield, where $60 buys you entry and all the beer you can drink, White added, “The people over there are kind of roughing it. Here, there are no shorts or tattoos. We’re going to go over late in the afternoon and see how drunk they are.”

The Preakness, second event in the Triple Crown, consistently draws the largest crowds of any sporting event in the Washington area or environs. That’s a good thing for Maryland’s legend-drenched but financially besieged horseracing industry. Profits from the Preakness and subsidies from slot machine gambling are the only things keeping horseracing alive in the state.

I give credit to the Preakness’s organizers in the Maryland Jockey Club. They’ve managed to pitch the race successfully to corporate executives and working people.

The well-to-do come to rub shoulders with the elite of Baltimore society and Maryland horse-country gentry. The hoi polloi come mainly to party.

But the two worlds of the Preakness have something in common. In both, many in the crowd know little or nothing about horseracing. They come to one race a year — the Preakness. And they come mainly for the scene. The race is just an excuse for everything else.

“We’re not avid horseracing people, but we love the atmosphere,” said Jenni Quinones, 30, a self-employed consultant who flew in from her home in Fort Lauderdale, Fla., and met three friends for the event.

“I enjoy the dressing up and doing something extravagant and seeing the beautiful people,” Quinones said. She wore a large floppy hat and a chic black-and-white dress.

Quinones spoke as she sat on a white couch in an open-air pavilion close to the track, near the finish line in what’s called the Turfside Terrace. That’s one step down from the Corporate Village, but still pretty posh. She paid $275 for the ticket, which included a buffet dinner and beer.

Over on the cheap side of the lawn, where people used blankets or lawn chairs they’d carried in, Terry, a 24-year-old student from Erie, Pa., said he didn’t care about the race. Asked why he drove eight hours to get here, he said simply, “to get as drunk as possible.” He asked that his surname be kept out of the paper to avoid embarrassment.

Of course, a lot of people in the crowd aren’t in the infield at all, but in the grandstand. That’s where the most serious bettors are. They pay attention to the 11 races before the Preakness, which was run shortly after 6 p.m. Scurrying back and forth to ticket windows, clutching sheafs of race information, they look like characters out of “Guys and Dolls.”

But even there, a lot of the action comes from amateurs. Max Baker, 64, a Superior Court judge from Egg Harbor Township, N.J., was poring over racing forms and placing $2 bets. But he conceded: “I come once a year, every year, and have no idea what I’m doing.”

The Jockey Club has drawn criticism for trying to attract a crowd by openly encouraging debauchery in the infield. This year it created a Preakness mascot, “Kegasus,” a centaur that urged revelers to “be legendary” in their partying.

For two years, it has also guaranteed a lubricated crowd by setting a flat rate for free refills of beer in the “mug club.”

“The mug club is hard to beat. You finish a beer, you get another beer,” enthused Ryan Woolverton, 25, a mechanical engineer from Philadelphia. He was also excited because he won a large stuffed horse at a booth by throwing a ball through a toilet seat 24 times. “Fun and mug. That sums up the Preakness,” Woolverton said.

He didn’t mention horseracing.