* Exceptions exist for subterranean mineral wealth, e.g. mining licenses can be issued against the wishes of a land owner
* Similarly the landowner has no exclusive right to the air above the property beyond some low altitude
* Compulsory acquisition can be invoked by the state
In many cases the landowner is compensated, though they may not like the amount. In the case of treasure in the UK the 1996 Act provides for a reward of "up to the market value". In those case the treasure hunters weren't on their own land and (https://www.herefordshirehoard.co.uk/the-story):
"The judge who sentenced the men said they had cheated not only the landowner, but also the public of ‘exceptionally rare and significant coins’.
Had the metal detectorists stayed on the right side of the law they could have expected to receive, as the judge pointed out to them, a half share or a third share of the hoard’s value."