I use Photoshop to create a panorama from 3-7 photos. Then I export it back into Lightroom. My RAW files are either DNGs or JPEGS when I import into Photoshop. When exported back to Lightroom, when I darken the skies through the gradient filter, the sky will show pixels. Why? How can I avoid this besides making the changes to each photo in Lightroom before exporting to create a panorama.
Typically the reason is that by darkening the sky you're basically mapping a certain range (say, 10 levels) in a more extended range (let's say twice as much, 20). Therefore you're actually enhancing the tone difference between adjacent pixels.
An extreme example of this is when you stretch the range so much that you start to see the quantization error: it means that two pixels that were just across the border between two tones (therefore impossible to distinguish) become visibly different.
You can partly correct for this by smoothing the image, even better if with selective smoothing to preserve detail. But the best way is of course not to have to stretch the exposure range. You can use exposure blending or HDR to capture higher dynamic range, and of course prefer RAW over JPEG as it has a wider dynamic range and no compression artifacts.