If you shoot RAW files, many apps that process these files can also apply lens correction, using metadata stored with the files, to create better images. In some cases, this can even be using a huge database of information about lenses and cameras.
It’s interesting to know that Apple’s Photos app also applies lens correction, yet doesn’t tell you anything about it. This lens correction is not only applied in the Photos app, but also within macOS; if you have a RAW file and view it using Quick Look (select the file and press the space bar), lens correction is applied.
For what it’s worth, I’ve found that the automatic preprocessing done in Photos is less visually pleasing than that in Lightroom. Chromatic aberration correction in Lightroom, in particular, seems a little better — not necessarily more accurate but better. This might vary by camera, though.