On the other end if a country is engaging in slavery or various derivatives of it, it’s still the fault of that government for allowing slavery to take place. If it’s a failed state then we have an obligation to not trade with that state, or perhaps even engage in nation building activities in an extreme case.
There are always things we can do. We simply choose not to as a people and by extension as a government. Unfortunately human nature and cognitive dissonance play a leading role in this and they are very, very good actors on the stage.
Spain has heard that some slavery is used by Subcontractor A at Mine B in Zimbabwe, which sells to Distributor C which also works with Mines D, E and F and sells bulk lithium on the international lithium markets where distributors G and H also sell, and where Battery Factory I buys some of their lithium but they also buy from J and K, and they manufacture cells under contract for battery brand L which sells them to home solar battery assembler M who also buy cells from brands N and O and actually only sell things ex-works in China, and Reseller P imports them into the EU.
Subcontractor A says the reports of slavery were wrong, that was actually perfectly legal prison labour. Mine B says actually they no longer work with Subcontractor A, and a local government inspector has certified them as slavery-free. Between C and O all the bulk materials get commingled, records occasionally get a bit mixed up, and precise sourcing details are commercially confidential. The battery reaches the shores of the EU with no known links to slavery.
If modern slavery has slaves picking fruit in the UK or working in brothels in Germany or washing cars in France, that's absolutely something those governments could crack down on, I agree.
On the other hand, if some lithium is mined by slaves and, after going through a complex supply chain spread across a bunch of countries, some of it ends up in devices that make their way to the Spain, or lowers world lithium prices benefiting Spanish consumers indirectly - the fact the slavery happened outside of Spain's jurisdiction makes it far more difficult for Spain to to throw the slavers in jail.