For most of the time that we think of as the African slave trade, Africans were captured by other Africans, brought to “forts” to be held, and kept there until being transported on slave ships to the Americas.
The Europeans who were bringing the slaves to the Americas did not go to Africa, land, and go out catching their own slaves. Instead, the slaves were sold to them by the Africans from the coastal states. Coastal states got slaves from farther inland. At times, they obtained the slaves after defeating their tribes in wars. At other times, they went raiding and captured the slaves that way. A final way of getting slaves was through trade, presumably with people who had gotten slaves through war or raiding themselves.
The Europeans had forts in the coastal states. They were called forts, but were more like trading posts with secure areas for keeping slaves. The Europeans would buy the slaves and then keep them in the forts until ships came to pick them up and bring them across the Atlantic to the Americas.