I don't think changing "which" to "them" is okay. I think it has to do with the connecting clause- "most of which have an effect on one another" . It is unnecessary for the sentence. You could remove it, and still have a functional sentence ("A country's capacity to produce wealth depends upon many factors." is functional.) According to Grammarly, "most of which have an effect on one another" would be a non-defining clause, and therefore, "which" would be the better choice, since "which" is used with non-defining clauses, and "that" or "them" are used with defining clauses.
Sorry if this is confusing. I'm a native English speaker, but my knowledge of grammar is not great. I looked this up on Grammarly and that's the best explanation I can give.