The concept of Haitian zombies was used as a threat to keep slaves working.
Before Haiti was an independent country it was the French colony of Saint-Domingue where they produced sugar, coffee, cotton, and other goods. The French brought more than a million West African people to the colony as slaves, more than any other colony in the Caribbean. Slavery in Saint-Domingue was particularly brutal – most people were poorly fed, they worked 12 hour days, pregnant slaves frequently didn’t live long enough to have babies, torture was common. Life expectancy was about 3-6 years with about half of the enslaved people of Saint-Domingue dying within the first few years of arriving.
Haitian Vodou & Zombies
The Code Noir was a 1685 decree that outlined how slavery was to be conducted in the French empire. Among other things it stated that slaves were prohibited from practicing African religions and instead were forcibly baptized into Catholicism. What resulted was Haitian Vodou, a religious blend of West African beliefs (practiced in secret) given a veneer of Catholicism.
Part of this belief system was the idea that, upon dying, you would return to lan guinée (ie. Guinea, or West Africa). Their idea of heaven was to escape the slavery of Saint-Domingue and to simply go home. Feeling the allure of going home some people decided to escape slavery on their own terms. As such suicide was very common Saint-Domingue.
Initially suicide was seen as a viable way of getting to lan guinée but at some point there was a change. At some point (oral tradition is murky on when/how) suicide was prohibited and the punishment for committing suicide was that you’d be a slave forever – you’d become a zombie. The zombies of Haitian Vodou are not the Western pop culture shambling brain-eating zombies. The Haitian zombie was someone whose soul had been captured, denied entry to lan guinée, and was turned into an undead field hand with no chance of escape. Plantation slave-drivers used this to their advantage threatening slaves that if they killed themselves they would be turned into zombies to work forever under the control of a bokor/sorcerer. Unlike today what was feared was the threat of becoming a zombie, not the actual zombies themselves.
Over time the zombie concept evolved and changed. The sensationalistic 1929 William Seabrook travel book The Magic Island introduced voodoo and zombies to mainstream Western culture. This inspired the 1932 film White Zombie, which was the first zombie movie. White Zombie stars Bela Lugosi as the villainous Murder Legendre (a bit on the nose) who’s a bokor enslaving people as zombies to be his henchmen and to work in his sugarcane mill. White Zombie used Haitian Vodou ideas but with a lot of artistic license. Later zombie stories dropped the Saint-Domingue threat of eternal slavery, then they dropped the bokor master commanding the zombies. Aside from being mindless undead creatures, the zombies of today have little resemblance to their sadder more terrifying origins.
Added info: following the Haitian revolution of 1791–1804, the 1883 Haitian Criminal Code outlaws the practice of turning someone into a zombie.