There were many forces behind the abolition of the trans-Atlantic slave trade. For various reasons, both slave owners and abolitionists backed this ban.
For abolitionists like William Wilberforce in Great Britain, there were two major reasons for banning the slave trade. First, it would be a humane move that would prevent more Africans from being enslaved. Second, if slave owners couldn't simply import new slaves all the time, they would need to treat their existing slaves in a more humane way.
For many slaveowners, the ban was a good thing as well. the main reason for this was that it would take some of the attention and disapproval away from their slave system. The trans-Atlantic trade looked (and was) terrible. Banning it would be a relatively low-cost way to improve their image.
And to add also the cost it took to keep the maintenance of the slaves and to pay the guards to prevent them from having a revolt. All of these points stated were quite expensive to there owners.