The people living on top of the resources may have legally relinquished their rights to it and the intact land it's buried beneath, but the drafters of those contracts have a lot of room and leverage to act in bad faith in order to exploit them. This can prevent these people from escaping a cycle of subjugation because they are given mere subsistence instead of wealth in return for their resources.
Legality of things like this are often just procedural facades to release mineral extraction companies from accusations that they are doing something wrong, harming someone or, sadly, indirectly enslaving vulnerable people.