What does it take to beat a sitting president running for reelection? If history is any guide, it takes a strong challenge from within the president's party. Since 1900, with one exception, every sitting president who failed to gain reelection faced a significant challenge from within his party. It works the other way as well. In the same time span, every sitting president, with one exception, that has faced significant opposition within his party failed to win the general election.
In 1912 William Taft faced a strong challenge for the nomination from Teddy Roosevelt. When Taft won the nomination, Teddy formed his Bull Moose party. Woodrow Wilson crushed Taft in the general election. In 1952 Senator Estes Kefauver of Tennessee defeated Harry Truman in the New Hampshire primary. Shortly thereafter Truman withdrew from the race. In 1968 Lyndon Johnson barely beat Eugene McCarthy in the New Hampshire primary. Four days later, Robert Kennedy entered the race and two weeks later Johnson withdrew. In 1976, Gerald Ford faced Ronald Reagan in the primaries and barely won, finally winning the nomination in a floor fight at the convention. Ford lost to Jimmy Carter in the general election. In 1980 Carter faced a strong challenge from Ted Kennedy who won 40% of the delegates to the Democratic convention. Carter was crushed by Ronald Reagan in the general election. In 1992, George H. W. Bush faced a symbolic but significant challenge from Patrick Buchanan. Although Buchanan won no state primaries and only an handful of delegates, he did win a significant percentage of the primary vote. His run highlighted the dissatisfaction with Bush felt by the conservative wing of the Republican party. Bush also faced a third party challenger, Ross Perot, who may have acted as a spoiler for Bush.
The one example of a sitting president facing a significant intra-party challenge and prevailing in the general election was Harry Truman in 1948. Truman faced a serious Party leaders approached Dwight Eisenhower, but he refused. (The Republicans also approached him in '48 bas well, but he turned them down also. He didn't reveal his party until 1952.) Truman also had a three way split in the Democratic Party, with the new Progressive Party nominating FDR's second Vice President, Henry Wallace. The Democratic Party split again at the convention over civil rights, with southern Democrats walking out and forming the Dixiecrats behind Strom Thurmond. Despite this significant party disunity, Truman pulled off the greatest upset ever in presidential politics, and won the general election.
The one example of a sitting president being defeated in the general election without facing a strong challenge for the nomination was in 1932, when Herbert Hoover easily won the Republican nod, but was soundly defeated by Franklin Roosevelt in the general election. OF course, this was in the midst of the Great Depression, and Hoover's policies were widely blamed for exacerbating the country's economic woes.
Given that history, this could be very bad news for the president.