This is because lenses effectively do a Fourier transform at the focal point. With the right setup, you can apply filters at the focal point and get pretty much exactly what you would expect. An example of such a setup is the 4F Correlator. [0]
Fourier optics is a whole subfield within optics, and it really is rather fascinating.
Exposure to Fourier optics really helped develop my intuition around the Fourier transform.
[0] https://en.wikipedia.org/wiki/Fourier_optics#4F_Correlator