Tank traps are designed to block tanks in a known area and buy time for other defenses.
It is very difficult for artillery to fire on moving tanks, and it used to be much more difficult. But when you have a tank trap in one location, you can have your guns aimed at that location. You can attack tanks from above, or take out crews or engineers trying to deal with obstacles.
Slowing down vehicles will prevent the use of blitz tactics even in places where you can’t make active defenses. If some traps have mines or active defenses, the intruder will need to prepare for this in all traps, slowing down the response.
Tank traps only work if the terrain forces an intruder through the trap location. If there are alternative routes, the pitfall is a waste of resources.