Liberia successfully resisted colonization because of an alliance with the United States. It was also, effectively already a colony since it was built and run entirely by African-Americans, not the indigenous Liberian population.
African countries had been economically devastated by the Atlantic slave trade.
It motivated other European countries to seek African colonies for their economic benefit.
African military forces focused on fighting one another rather than European armies.
They created a foundation for colonialism by introducing Western beliefs to foreign countries.