The enemy is constrained by size, cost, power, and heat dissipation. What can be done on the ground is not the same as what can be done in a fighter plane, and that isn't the same as what can be done in a small-diameter missile, and that isn't the same as what can be done in an anti-aircraft shell.
The enemy might be able to briefly detect at close range, reliably track at long range, or anything in between.
Because of this, stealth is not simply defeated, and it does not suddenly become 100% useless.