Article 2, Section 3 of the US Constitution: "[The President] shall take Care that the Laws be faithfully executed"
The judiciary doesn't have discretion as in it has been "granted" discretion. It de facto has a high degree of discretion because the act of judging a case necessarily entails a judgment of the laws.
Judicial review is a functional necessity. It's a necessary downstream consequence of simply having a Constitution as the supreme law.
The analog to the executive is that the executive naturally has finite resources to enforce law, and so as a matter of functional necessity it has some degree of discretion. That is not discretion to say "I disagree with this law and so am choosing not to enforce it," but the discretion to say "there are other priorities that are more important."