Well, all games are optimized. Just a matter of when, how well they do it, and the limitations of the code they've written. These days it is popular to release games that aren't quite finished and let a zero day patch take care of known issues.
Games developed against a particular engine rely on the software tools and expertise available from the engine developer. They will look at how the software interacts with hardware drivers and implement ways to streamline the process.
Another type of optimization is features related. If you have an AMD GPU that can do one particular type of rendering very well, then you set up the game to use that rendering method when an AMD GPU is detected. This can be done by the game developers as well as...