Napoleon took power less than a generation after the French Revolution. He had a lot of support from the Army and the people, how was this possible? Why would the French people support someone who was essentially making himself king after they had so recently gotten rid of their king, rejecting the very idea of monarchy. Yet there was very little resistance to the transition from republic to empire. How did this happen?
This is a very interesting question though a definite answer probably cannot be given. I strongly disagree with Tom Au statement that Egyptian expedition "was a considerable success". It was a total failure: French army had to surrender and be evacuated from Egypt in British ships. What worse humiliation one can imagine?French navy was destroyed in the battle of of Aboukir Bay. If this is a "considerable success" then what is a complete failure?
On my opinion, (and I agree with Tom here) the revolution was not so much against the monarchy but against the outdated social structure, privileges of nobility etc. In this respect Napoleon time was considered a continuation of the revolution. People did not like the terror and the government of the Directory, and it was clear that some kind of strong power or dictatorship was desirable, if the new social and economic order could be preserved.
The idea that the revolution had "anti-foreign", "nationalistic" character is really interesting, but I would like to see more evidence of this, except the wording of the Marceillaise.
There is some analogy with establishing empire in the Roman republic. The idea of monarchy was always extremely unpopular in Rome. And no emperor called himself a king, even in later times. But establishment of the empire was considered necessary to stop continuous civil wars. It seems clear that the French of the Napoleon times very clearly understood this analogy. Napoleon was called "Consul", and later "Emperor", the names taken from the ancient Rome. And he really was a warlord, like Caesar and August and many later emperors.
Napoleon won an number of important battles against Austrian and Italian invaders in the late 1790s. Then he occupied Malta on the way to invading Egypt with considerable initial success before its ultimate failure. In so doing, he kept alive the French Revolution, which was "suspect" by other European powers because it had deposed its king.
By this time, the French Revolution wasn't anti-monarchist. It was, instead, anti-foreign and nationalistic. My translation of the Marseillaise begins: "Arise ye children of the fatherland, the day of glory has arrived." Napoleon catered to this "revolutionary" sentiment even though he crowned himself Emperor.