In 1807, a British law banned British ships from the slave trade. That trade meant shipping enslaved Africans across the Atlantic Ocean.
But the law only stopped the shipping. It didn't free people already enslaved in Britain's colonies, the overseas lands Britain ruled.
Owning enslaved people stayed legal in most colonies. A second law in 1833 began to end that.