Is it related to the revolution in Haiti?
The story of France’s stance on slavery between 1794 and 1802 was never a unanimous one, rather different pro and anti-slavery factions were constantly trying to pressure the government to side with them over the others. This is all deeply interconnected to the Haitian Revolution, so I’ll try and focus more on your question rather than getting too bogged down in the history. I’m happy to elaborate on any details though.
First, let’s set the stage for the 1794 decision to abolish slavery. In France, there was a fierce ongoing debate on the issue of slavery. The Declaration of the Rights of Man was the foundation of the constitution, and the government was wrestling with the contradiction of basing their government off the idea of fundamental rights while still allowing for slavery. You had factions arguing on either side as well. Wealthy plantation owners in Paris had formed a pro-slavery movement called the Club Massiac, which was continually lobbying the government to maintain slavery in the colonies by force. On the other side of the isle, you had notable politicians like Jacques Pierre Brissott organizing anti-slavery clubs like The Society of the Friends of the Blacks, although it had become inactive after Brissott and his Girondin allies had been purged from the government years earlier. Through this whole period, the government has been flip-flopping between allowing for equality between free people of color and whites, and enforcing racist policies designed to create resentment between free people of color and whites – who they feared might otherwise join forces to oppose the direct rule of the colony by France.
In Saint Domingue (modern day Haiti), things were a bit more tense. The Haitian Revolution began in 1791 with a massive slave revolt, and those who were not enslaved were mostly trapped in a handful of port cities. Slave armies controlled the vast majority of the country. Spanish sympathizers from the neighboring colony of Santo Domingo were supplying the slaves with weapons and supplies from across the border. The British had also landed troops in an effort to seize the island for themselves, or at the very least, keep France from taking it back. The French that were left on the island were fiercely divided amongst themselves. Poor working whites were fighting both the slaves and the French government over their refusal to enforce racist policies which kept the Free Colored class below the poor white. Wealthy whites had a deep distrust of both the Free Colored class and representatives from France itself, who they feared might negotiate away their slaveholding rights. All military attempts to put down the slave revolt had been colossal failures. Keep in mind that before the revolution, Saint Domingue was one of the most profitable colonies in the world, and France was hurting badly without the income.
The end of slavery came after a few events tipped the scales in the abolitionist’s favor. First, one of the French representatives in Saint Domingue, named Léger-Félicité Sonthonax, unilaterally emancipated the slaves on the condition that they go back to work as paid laborers, and that they did not help the British. Then they sent the “Tricolor Commission” made up of one white, one former slave, and one free person of color to Paris to argue for official approval of the emancipation. Second, the wealthy white plantation owners in Paris had been caught trying to surrender the colony to the British in return for their help recapturing their plantations. With the pro-slavery lobby reeling, the British advancing, and the slaves already promised freedom, the French government not only approved Sonthonax’s emancipation, but removed all working conditions and threw in full citizenship. The slaves were free. When the news reached Saint Domingue, the de-facto leader of the slave revolt, Toussaint Louverture, turned his back on the Spanish and aligned himself with the French government against the British. Morality aside, the decision to end slavery was a sound political, economic, and military decision at the time.
By the time Napoleon arrived on the scene, things had quieted down in Saint Domingue. Toussaint Louverture is overseeing it’s plantation economy, and running it with a good deal of autonomy. But Napoleon had a greater plan to recreate the French colonial empire, and he would need more direct control of the colony and its profits, and by April 1802 his notes showed that reinstituting slavery was part of his plan. Former white plantation owners had made their way back on the scene as well, and were pushing Napoleon to retake the colony by force. When the British fleet agreed to let the French sail to Saint Domingue to retake the colony, Napoleon jumped at the opportunity. While Toussaint was eventually captured and killed, the rest of the operation was a disaster. The French expedition lost tens of thousands of men to disease and the ensuing guerrilla warfare, and Napoleon was eventually forced to give up his plans for a new overseas empire. This is also what prompted him to sell French Louisiana to the United States.
In both cases, the abolition and the re-institution of slavery came down to being sound political, economical, and military decisions at the time. The abolition especially has its roots in practicality instead of a moral objection to slavery – although there certainly were die-hard abolitionists who felt it was morally wrong.
David Geggus, Jeremy Popkin, Laurent Dubois and John Garrigus have all written comprehensive histories of the Haitian Revolution, and they’re the ones I am most familiar with. I’m familiar with a number of more focused publications as well if you’d like recommendations on something more specific.
Edit: As always, edited for spelling and formatting