Republican Senatorial candidate Roy Moore speaks during a campaign event at Jordan's Activity Barn on December 11, 2017. Getty Images

Today's unpredictable special election for the U.S. Senate in Alabama highlights the two central dynamics of 2017 politics: surging Democratic energy and steadfast loyalty among the president's hardcore supporters. What propels Democrat Doug Jones — in a state where his party hasn't won a Senate race in a quarter century — is renewed energy among Democratic voters who were irate about President Donald Trump long before allegations surfaced of child molestation by Jones' Republican opponent. Democratic enthusiasm fueled the 10-percentage-point lead that Fox News pollsters measured for Jones in its pre-election survey. Yet, what keeps Republican Roy Moore a narrow favorite in the race is the staunch loyalty of core GOP conservatives — not only to the candidate but to the president, who has endorsed Moore. Though their ranks have shrunk as both men struggle with self-inflicted wounds, in a state as conservative as Alabama even a diminished and dispirited base could be enough to win.

Democratic senatorial candidate Doug Jones. Getty Images

Those broad contours match the stories that have played out in special elections all year. With many voters irate about Trump's performance in the White House, Democratic candidates have consistently done better than in pre-Trump elections. Republicans, benefiting from friendly red-state venues for those contests, have won most of them anyway. It happened in Kansas and Montana, where races to fill the House seats of Republicans appointed to Trump's Cabinet ended with closer-than-expected GOP victories. It happened in Georgia, where a surge of campaign cash and volunteers behind Democrat Jon Ossoff — layered by disaffection with Trump among college-educated swing voters — couldn't overcome traditional Republican support for Karen Handel in a suburban Atlanta district. The pattern was broken last month in Virginia, where the swelling ranks of college-educated suburbanites and minorities in the Washington, D.C., suburbs have made the state a closely contested battleground. There, Democrat Ralph Northam won comfortably over Trump-backed Republican Ed Gillespie. Northam's party also scored big gains in the state Legislature. Alabama poses a confounding test because the circumstances are so extreme. The state ranks among the most conservative in the nation. The last Democrat elected to the Senate here was Richard Shelby in 1992; he switched parties and became a Republican thereafter. Trump defeated Hillary Clinton here by nearly a 2-to-1 margin. The allegations against Moore — charges that he molested a 14-year-old and dated other teenage girls as a man in his 30s — are about as damning as allegations against a candidate can get. The charges have turned a significant chunk of upscale, better-educated voters, especially women, against him in suburbs around Birmingham and other urban areas.

Moore's comments about race relations — including one waxing nostalgic about slavery — have also heightened his vulnerability among African-Americans, which comprise about one-fourth of the state's electorate. What no one can say with high confidence is who will turn out to vote Tuesday. Special elections pose major challenges of mobilization for all sides because they occur at irregular times. One Republican fear — punctuated by Shelby declaring that he couldn't vote for Moore — is an unusually high number of Republican defections. Another is that conservatives discouraged by news about Moore may simply stay home. Democrats worry about ensuring that their more unified but smaller base understands the stakes of the election and will show up to vote. That's why national party figures, including former President Barack Obama, have been participating in a massive pre-election turnout effort, especially in African-American precincts.

Voters head in to cast their ballot as the doors open at a polling station setup in the St Thomas Episcopal Church on December 12, 2017 in Birmingham, Alabama. Getty Images