Napoleon Bonaparte and his nephew Louis Napoleon both came to power from a republic. Bonaparte's origin in the First French Republic meant that he maintained and increased his legitimacy through the vestiges of the republic. Although an Emperor in his own right, he paid respect to the republic and the revolution from which it was built by establishing a constitution. This constitution provided for a republic in name only, and Napoleon was certainly a dictator.
Louis Napoleon likewise transitioned from a republic to an Emperor. However, his legitimacy rested in the will of the people. He used plebiscites to justify his power and actions. Some of these plebiscites returned 90% or above "yes" votes. Louis Napoleon's legitimacy of power rested in the French people's support for him.
The difference in titles reflects where each Napoleon derived legitimacy: Bonaparte, from the revolution and republic, and Louis, from the will of the people.
Sources:
François Furet, The French Revolution, 1770–1814 (1996)
Dieter Nohlen, Elections in Europe: A data handbook (2010)
Napoleon I enacted a new Constitution at his elevation to the Imperial crown, ratified by referendum shortly before his coronation, whereas Napoleon III derived his title from amendments to the existing Constitution enacted after his suppression of the republican National Assembly a year earlier. He might have styled himself Emperor "by the Grace of God and the Constitution of the Republic, as amended", but it may have been too much of a mouthful or merely inelegant.