The Trump administration’s hostile approach to South Africa was shaped by a convergence of factors.