From what I’ve always heard, they only know of exoplanets when they slightly dim their star as they transverse across it.
Now they can tell what the atmosphere contains from THAT?
Technology has greatly improved. It’s done with spectrum measurements.