Franklin County is home to Frankfort, Kentucky's capital city. State capitols usually are more Democratic than their states as a whole, due to possessing both a substantial government workforce and a notable minority population, as well as large numbers of younger, college-educated voters. Denver, Colorado, Atlanta, Georgia, Santa Fe, New Mexico, and Austin, Texas are examples of this.
A combination of the three clearly does the trick--and perhaps all three of them have roughly equal impact. This moves states like Leon County, FL (with FSU in Tallahassee) and East Baton Rouge, LA (with LSU in Baton Rouge) to Democratic leaning even though the surrounding part of the state is quite Republican.
Without a substantial minority population or a large university, the size of the state and corresponding government workforce in the red states becomes significant. Which is why Burleigh County, ND (Bismarck) and Hughes County, SD (Pierre) with small populations reflect the states' Republican lean. On the other hand, Shawnee County, KS (Topeka) has tilted Democratic for many years and actually voted for Biden in 2020. And Biden came close in Franklin County, KY as well.