As tobalt wrote, it's all about surface brightness. But the crucial bit, which is not apparent enough, is just how much brighter these stars appear than the further away galaxies. If JWST had taken the picture with lower exposure it could have captured this more faithfully, perhaps like this:
...but that wouldn't be very useful for scientific purposes and certainly not look as inspiring.
Due to a combination of overexposure of the sensor itself, and post-processing, we see much more information in the actual published image, – but at the price of discarding the direct information about the foreground stars' brightness, and also of blowing the intensity of their diffraction spikes completely out of proportion. (Which does of course provide a way of estimating the true brightness again, as well as a visual impression of their "brilliance".)