It really doesn't (mitigate tanking). And yet, here we are.
The system is flawed in that a team like Portland, who had nearly double the amount of wins of Detroit had nearly only 10% worse odds of picking top 4. That the Pistons were essentially a 50/50 shot of ending up where they did despite being the only team to not win 20 games in the league.
This is the exact same thing we just talked about in 2020 regarding the NHL. And the NHL changed their format to mitigate this type of thing from happening.
What is more detrimental to the league, bad teams try to be really bad, or bad teams are made perpetually bad because of a system that limits their chance to acquire difference makers?
Just limit the lottery to fewer teams, limit the number of picks in the lottery, limit the number of wins in a set period of time. Force teams to attempt to build after winning. It really shouldn't be as hard as they have made it for bad teams to be good