Due to a series of coups and semi-illegal laws, the French Directory was generally failing to be an effective and stable government. Rather than work as democracy, groups were removed (such as Royalists in 1797) in order to keep power within the hands of the Directory and away from perceived enemies. In combination with this, France reentered war against Continental Europe losing ground in Italy. In the interest of creating a stable government, Director Sieyes was looking to stop the Jacobin's from further ruining the French government and looked around at possible replacements from generals stationed in France. (Soldiers were stated in and around Paris to help in case of any sort of revolt or political crisis, very unrepublican of the Directory). Generals Moreau and MacDonald were approached but refused to take part in any sort of coup, both of which were very republican and balked at the idea before it could have been discussed. It happened that when Napoleon returned in late 1799, Sieyes looked at the very popular general and spoke to him about helping bring stability to France.
1815 was very different; France was tired in 1814. Napoleon was winning stunning victories but the Allies kept on pushing forward to Paris until it was taken. When Napoleon surrendered, France was properly at peace for the first time in over a decade. The Allies put Louis XVIII on the French throne and life was supposed to go back to normal. However, the people still remembered Napoleon and the Revolution.
After Louis XVIII returned, so did the old attempts to pretend the Revolution didn't. He claimed to have ruled France since the death of the Dauphin of France in 1793, he returned to the purchasing of offices and ranks (as well as the highly coveted Legion of Honor). The meritocracy was replaced by the aristocracy that was returning from their time abroad, and all of this wasn't welcome by the people. While some were loyal to the King, many grumbled. Then sudden Napoleon returned from Elba.
With Napoleon's return, the people flocked to the memories of meritocracy and semi-egalitarianism as well as returning to his magnetic personality that the wet towelled Louis XVIII didn't have. Some returned out of loyalty, others out of duty, while some fled with the King. Both times, Napoleon was the best candidate of what was present.