The economy in most of the district is doing well, with pockets of poverty, mostly in rural areas. In Scott County, where Ms. McGrath lives, the largest Toyota plant in the world churns out Camrys and Lexus sedans, a factory that could be hurt by Mr. Trump’s proposed tariffs. The Kentucky Bourbon Trail runs through the district, attracting tourists to another export that has been targeted for retaliatory tariffs by trading partners suffering from the president’s attacks on their steel and aluminum industries.

The horse industry is as durable as the bluegrass — this year’s Triple Crown winner, Justify, lives on WinStar Farm, adjacent to Mr. Chandler’s homestead. In Clark County, Ale-8-One soda is a local staple made in Winchester and sold throughout the district. Many of the nation’s chemical weapons are stored at the Blue Grass Army Depot in Richmond, another sizable employer. The eastern part of the district is less well educated and more economically distressed.

A Democrat’s path to victory starts in Lexington, a city of more than 300,000 in a county with the state’s highest percentage of college graduates that often provides about 40 percent of the overall vote. Lexington is ringed by suburbs where Democrats are hoping Ms. McGrath can pick off the votes of suburban women and men who will be drawn to her military service.