Bourbon is a wonderful thing, just wonderful, and perhaps no television show in American history has realized this, or had as much fun with it, as “Justified.” A subplot of the show is that it’s (sort of) to bourbon what “Sideways” was to California wine — a lovingly told inside joke.

The show is set in Kentucky, the drink’s ancestral home, and the producers have had a spirited (sorry) time showcasing the stuff and making it an integral part of the plot. William Faulkner, who knew his way around the sour-mash barrel (Four Roses was his favorite), famously opined that “Civilization begins with distillation.” Raylan Givens, the deputy U.S. Marshal who is the show’s protagonist, put it this way earlier this season: “Bourbon is easy to understand. Tastes like a warm summer day.”

Preach, brother Raylan!

Taylor Elmore, an executive producer and one of the show’s main writers, confirmed for us that none of this is by chance.

“We kind of define these characters sociologically and financially by the bourbons they drink,” he said in a phone interview. “The props people and the writers have been careful about this.”

This fine-tuned wit has not been lost on fans. Because bourbons, unlike wines, come in distinctive bottles, the pros can recognize what the characters are drinking even if the label isn’t shown and the brand isn’t mentioned.

“It’s gotten to be a game for me — I’m so busy watching the bottles at the back of the bar I have to rewind it to see what they said,” says Carla Carlton, aka “The Bourbon Babe,” who runs a popular blog about both “Justified” and bourbon.

First: Elmore says the show doesn’t accept payment for product placement. But, as it happens, they did ask Buffalo Trace, a distillery that produces several different brands (each made with a different mash bill, or recipe) for empty bottles and props, which a distillery spokeswoman says they supplied, free of charge. Ergo, a lot of the bourbons in the show have Buffalo Trace roots.

Second, since you asked: Tea. Tea is what’s in all those bottles and shot glasses. Though the show is filmed in California (that sure isn’t Kentucky), we’re just going to assume it’s sweet tea.

Okay. Ready?

The first joke is that bourbon seems to be all anyone drinks (save for coffee and moonshine), at any hour, on any occasion. Why, when Ava got out of prison, how did she start our her day? With a nutritious breakfast of cereal and Wild Turkey, natch! At 101 proof! If this isn’t the flying colors of a femme fatale, what is?

Second, let’s look at character development.

Ava is a country kid who is not terribly upscale. Neither is her bourbon. “Wild” is an old-school label, a staple long before the small-batch (or specialty) labels began a revolution in the industry about 20 years ago. Her morning pour tells us that not only does she have a wee drinking problem, she’s been sticking with one brand a long time, even as tonier choices have come along.

Nobody on the show, however, is matched more to a brand than her beloved fee-ahn-say, Boyd Crowder. He professes to only drink with “…people I like, or I pretend to like,” and when he’s drinking? It’s Elmer T. Lee, as seen here.

Boyd is your outlaw antihero, and your very fine Elmer’s (hard to find these days, in part because of the show’s popularity) goes for about $30/bottle. Lee, a Kentucky native, was the first master distiller for what is now the aforementioned Buffalo Trace. Lee also bottled the world’s first single barrel bourbon.

Boyd, another native Kentuckian, is drinking it neat here, rather than with a splash of branch water. Here’s how Lee’s is described on “Elmer T. Lee (ETL) is no frills, no fancy marketing, it wasn’t aged on the ocean, and there are dozens of other bottles higher on the shelf. You won’t find ETL on a GQ top ten list, but you will find it open in the cabinets of diehard bourbon enthusiasts everywhere.”

That’s pretty much Boyd, right down the line.

But let’s go to the other side of the law, because the cops drink just as much as the criminals.

Art, the boss of the Marshal’s service, is a Blanton’s man. You can tell by distinctive shape of the bottle, and the horse-and-jockey figurine atop the stopper. It goes for about $40/bottle and tells us Art is a grown man with discerning taste.

He keeps a bottle in the office, which makes him a particularly good boss, especially when he invites you in for a taste, as he’s prone to do.

But when there’s a special occasion, he knows how to class it up. When they take down big-time Detroit mobster Theo Tonin, they open a bottle of Pappy Van Winkle, apparently the 20-year-old Family Reserve. This is good casting.

Pappy’s has come to be regarded as one of the best bourbons on earth, and, in a bit of savvy marketing, bottler Julian P. Van Winkle III (you can get away with that sort of name if your bourbon is that good) releases only 6,000 or 7,000 cases each year. Rare is the store that would get more than half a dozen bottles.  It’s become a sort of cult fetish and thus, it’s just the sort of thing you’d keep for a special, career-capping achievement such as bringing down Tonin. It retails for about $129.

Also, note they didn’t overreach and have a bottle of the 23-year Reserve (identifiable by the extra band across the neck of the bottle), because that’s just impossible to find. It’s ridiculous. It retails at about $249, can easily command more than $1,000 on resale, and, on a recent day, an empty bottle and the bag it came in was offered at $50 on E-bay, and 11 bids had pushed it to $81. We repeat: That’s for an empty bottle.

But when Art is recuperating from a gunshot wound at home? Raylan drops by with a bottle of … Blanton’s. It’s a telling emphasis of their friendship, that Raylan would know this is his boss’s daily brand and seek it out.

Arlo, Raylan’s dad and lifelong petty criminal? Not so high class. He, like Ava, went for Wild Turkey. This was perfect character-to-bourbon casting. It’s just what a 70-year-old screw-up of his place and time would drink.

Mags Bennett also was set apart by her alcohol choice: Her “apple pie” moonshine. She descends from kin that ran illegal distilleries and still runs her own. She was rarely seen to drink anything else. Of course, she poisoned Loretta’s dad and, later, herself with it. (“It was already in the glass.”)

So what does Raylan, the star of the show, drink? Apparently, whatever’s in front of him. When he orders at that Mexican bar we featured at the top, he just says, “bourbon.” That is, in its way, a statement.

“He’s partial to all of it,” says Elmore, the writer and producer. “[His lack of a preferred brand] is a conscious decision we made…being the son of Arlo, a low-class criminal, he’s got a little of that to him. Raylan would never want to be seen as highfalutin.”

How do they establish that? With alcohol, of course.

In an episode this year, a coal-mining friend from Raylan’s teenage years remembers how Raylan would read a book at lunch but couldn’t wait to “get at the Mason jars” full of ‘shine when he was a teen, suggesting that what he was after was liquor, not just fine bourbon.

At home, we see him drinking Ancient Age (found on the lower shelves). He went out one night to a batting cage to get out some frustration? We see him taking nips from a flask-sized bottle of Jim Beam.

Beam is one of the nation’s oldest bourbon distillers, and now runs a family of labels that go from the bottom to the top. But the basic product is your old-school Pabst Blue Ribbon of bourbons. It’s straight-forward, not particularly polished, and there’s a lot better out there. Economy is the main reason to drink it — that flask would be about $5 — and suggests Raylan does indeed have hardscrabble roots.

In “Justified,” bourbon is also used to emphasize place, not just character.

At the Crowe’s low-rent house of ill repute, the pre-pubescent Kendal is tending bar. He passes the time by making cocktails — “This Place Sucks” is one — and he’s using Ancient Age, subtly emphasizing what kind of joint this is.

Now, over at Boyd’s bar? They have a classier selection.

A couple of dudes roll in and ask the bartender: “Got Maker’s?” The bartender smiles and asks the dude if a bear poops in the woods. Of course they’d have the Volvo of bourbons, Maker’s Mark! Known by its red wax top, it’s a solid, respectable — if not flashy choice — and it’s ubiquitous. It is less spicy and smoother on the palate because it has a higher percentage of wheat than many other bourbons. (Rye is what gives bourbon the spicy, pepperish kick.)

Maker’s is such a staple that Miller, the functionally alcoholic DEA agent, refills his flask with it. Good call for the road.

And, finally, one more joke.

At Boyd’s bar, bad guy Ty Walker strolls into the joint and asks for Buffalo Trace (your medium range choice, about $22/bottle) and downs two shots in front of a “Jack Daniel’s” neon sign. HAHAHAHA.

As anyone who knows enough to watch this show knows, Jack Daniels is not bourbon. It is Tennessee whiskey. People often think that to be named “bourbon” the drink must be made in Kentucky. No. It only has to be made in the U.S. and be composed of 51 percent (usually much higher) corn and a couple of other prerequisites.

The regional distinction actually belongs to Tennessee whiskey, which adheres to something called the Lincoln County Process. This is chiefly composed of running the bourbon through a charcoal filter. You either think that greatly improves the flavor or you think it takes all of it out. Generally speaking, bourbon fans can’t ridicule it fast enough, and Tennessee whiskey fans think bourbon folks are snobs who don’t have the right. Ergo, the joke: Drinking bourbon in front of Tennessee whiskey sign, playing the two groups off one another.

Well played, “Justified.” Well played.