Hypothesis tests can be inverted to create confidence intervals and, conversely, confidence intervals can be used to derive hypothesis tests.
The intuition is straightforward: A hypothesis test of a point null tests whether a parameter is equal to a particular value . If we gather all such that the null is not rejected, then this is a confidence interval. Likewise, if we have a CI , we can simply reject the null if .
This duality also holds for confidence sequences, see eg my notes here.