The impact of the gun trade
The mass introduction of firearms was the single most significant technological innovation brought by Europeans to West Africa. Kings and warlords were anxious to trade with Europeans to acquire guns.
Twenty million guns were imported to Africa in the second half of the 18th century. Many guns imported by the British were manufactured in Birmingham.
African rulers exchanged captives for guns. Rulers were in competition with each other, so the acquisition of guns provided an edge over their rivals. This increased their drive to capture and sell slaves. The new availability of guns was a direct consequence of the slave trade.
The mass importation of guns for slaves altered the conduct of warfare in Africa and changed the balance of power between kingdoms.
At the height of the Atlantic trade only states equipped with guns were able to resist attacks from their neighbours. The demand for slaves, combined with the supply of guns, encouraged rulers to attack neighbours.
Source:
https://www.bbc.com/education/guides/zxt3gk7/revision/2
----
Slavery existed in West Africa for many centuries. These enslaved people were servants or workers. Some of them had been captured during wars or had been found guilty of crimes. People from West Africa were also traded across the Sahara desert.
Each year, several thousand Africans were traded to countries in the Middle East for salt and other goods. Although these slaves were not free, many of the slaves in West Africa remained part of the larger family in a village. They may have had fewer rights than other villagers, but they could own land to farm. They could even become skilled workers and earn money. Their descendants could become free. Traders from Europe changed this way of life in West Africa.
After founding colonies in the Americas, many Europeans had sugar and tobacco plantations that needed workers. Using slaves was a cheap way to get the work done.
Traders from Europe went to West Africa and offered cloth, rum, salt, and other goods in exchange for slaves. Many Africans became wealthy by trading slaves for goods like these. In addition to these goods, the European traders also offered to trade guns for slaves. A village that had guns became more powerful than its neighbors. As one village grew in power, its neighboring villages were often forced to sell slaves to Europeans in exchange for weapons to protect themselves. Soon, groups all over West Africa were capturing and enslaving people to trade for guns.
-----
The well-armed fort provided a secure harbor for Portuguese (and later Dutch and English) ships. Africans were either captured in warring raids or kidnapped and taken to the port by African slave traders. There they were exchanged for iron, guns, gunpowder, mirrors, knives, cloth, and beads brought by boat from Europe.
Source:
http://www.pbs.org/wgbh/aia/part1/1narr1.html