Once again, optimizing is not the same as powergaming. Powergaming is literally gaming for power, it is striving to dominate the game at all costs, not necessarily in competition against other players, in fact many powergamers probably complain with the group that the other players aren't keeping up and powergaming too. It's more about wanting to dominate and trivialize the challenges of the game instead of enjoying them. It's the equivalent of looking for tricks or bugs (or "cheat legally") in a computer game in order to cruise through it with ease.
If you are optimizing your character you are not necessarily powergaming, but on the other hand a powergamer is always also an optimizer. I know, because I've been there during the 3e era. I was good at understanding the rules and thus at optimizing my characters. The problem was that sometimes I could feel that my PC was too much better than the others played by more casual gamers, and I did not like it. So I started to purposefully create characters in a different way, not necessarily purposefully making them bad (although sometimes I actually did), but for example focus more on horizontal than vertical growth, or to try out new things instead of picking a character choice that I had already verified it worked. I often purposefully picked an apparently sub-par spell or feat in order to set myself the new challenge of making it worth.
System Mastery -based design sounded a good idea back then, what could be wrong in rewarding someone for wanting to play well? Unfortunately it creates the conditions for confusing playing well with dominating the game. The results are you are actually playing worse from the point of view of everyone else enjoying the game. And some powergamers themselves don't enjoy the game either but merely enjoy their sense of being better than everyone else.
Let me tell you a partially-related story...
A long time ago, me and my closest group of friends started the habit of playing chess during our long evenings together. We had fun for a few months. Then one of us decided to take a step further and bought a book on chess tactics, and shared it with his brother. In a month or so they studied the book and became unbeatable by the rest of us, and matches became a pushover. How could you blame them for wanting to learn to play better? But the ultimate problem was that suddenly the group was split, we just could not play all together anymore, those 2 could only play against each other and the rest by themselves. Final result, we never played chess together again. What seemed to be a good idea turned out to be distruptive.
Fortunately D&D has a huge advantage: you don't have to feel stupid if you know how to dominate the game but choose not to. Once those friends learned chess tactics, the only way to restore balance to the group would have been for everyone else to read the same book (but apparently, we weren't interested enough in investing our time like that), they just could not purposefully play dumb once they knew better. But D&D offers so much character diversity that if you ever figure out one "combo" to break the game, you can easily just play something else that makes the game more healthy challenging. The problem is powergamers still feel stupid if they don't pick that combo. If that's the case, they should just play together in a group of sole powergamers, and don't bring detriment to other players.