> Webb will also carry coronagraphs to enable direct imaging of exoplanets near bright stars. The image of an exoplanet would just be a spot, not a grand panorama, but by studying that spot, we can learn a great deal about it. That includes its color, differences between winter and summer, vegetation, rotation, weather...How is this done? The answer again is spectroscopy.
https://commons.wikimedia.org/wiki/File:HR_8799_Orbiting_Exo...
Of course the above doesn’t account for lensing and who knows what else, but you get the idea. (If my math is correct)
So even though the JWST is a larger scope, Hubble's visible wavelength photos are higher resolution than JWST's longer wavelength photos.
In a lot of cases, we infer the presence of planets by making very precise measurements of relative velocities of stars (using red/blue shift of light) and making note of periodic wobbles that indicate that its position is being affected by planets.