You want the most power, the best fuel economy, the cleanest emissions, and the longest longevity out of any engine. But each of these conditions requires different tuning, generally opposite from each other. An engine needs to be tuned to operate at a sweet spot that is the compromise of all requirements. As I said earlier, pinging can be the result of high combustion temps, and this is the type you would expect to occur. High temps are caused by a combination of lean fuel and advanced timing.
Lean fuel produces higher combustion temps and hence more power.
It also produces higher emissions and potential engine damage. That is normal. That is desired. Yes, you are damaging the engine and melting the piston. That means that you have crossed the line are no longer is that compromise zone.