It is not super easy to compare all years but here is my best try for the US GT trim level:
2019:
- Assuming you already know all the included options like ventilated seats, etc
2020:
- Added G Vectoring control Plus (update of G Vectoring Control on the 2019)
- Larger infotainment display (9 inch instead of 8 inch)
-new key fob design
-power adjustable second row bench seat
-Optional 2nd row captain chairs with center walkthrough instead of the bench seat
- Power increase from 310 lb-ft of torque to 320 lb-ft (with 93 octane fuel) power remain 310 lb-ft with 87 octane fuel
-3rd row dual USB charging port
-Added hands free rear power liftgate (open with your foot)
2021:
-New infotainment software
- Larger infotainment display (10.3 inch)
-Wireless phone charger
-Paddle shifters
-improved exterior cameras (better backup and 360 cameras)
-Added Driver Attention Alert
- Added Smart City Brake Support - Reverse (was only available forward before)
2022
- All wheel drive is now standard, it was optional before.
2023
- I believe it remained pretty much the same as for 2022
Known issues:
2021 have oil consumption problems (Mazda provided extended warranty for it)
2016 to 2020 have the risk of cracked cylinder head (Mazda just extended the warranty on the cylinder head for it).
I currently have a 2018. If it would be me, I would not consider 2016-2020 models because the old infotainment really makes the car looks like a generation older. The 2021 update to screen and to the infotainment make the car feel a lot more recent and will age better, plus I would be more confortable with the redesigned cylinder head. The oil consumption issue on the 2021 is only a specific range of VIN based on when they were built. If choosing a 2021 I would do my best to avoid models within that VIN range. 2022 and up are safe bet in my opinion.
If you decide to get a model 2020 and below model, check the history and make sure the engine has not been replaced. The reason I am saying this is because the extended warranty on the engine applies to the original engine, but not necessarily to the replacement engine.
The CX-9 is a great car, I love my 2018 and almost replaced it with a 2022. Ultimately I decided against it because I prefer the bench seat over the captain's chairs and the 2018 has been serving me well. The infotainment system age for 2019 and 2020 models, you can decide if it is an issue or not for you. I use Apple CarPlay all the time, so it's age doesn't really show in my 2018, but the larger screen in the 2019 and 2020 looks a bit odd to me, because they made them square instead of rectangular, and they don't fit as well in the design in my opinion compared to the 2018 screen and the 2021 and up screen. The 2021 design looks a lot better, but overall functionality is similar, and they can all run apple CarPlay.