In many ways, Nvidia is acting like Intel did. AMD simply couldn't compete on performance so this allowed them to get cosy (Intel's high-end for consumers stayed at 4 cores for a decade, Nvidia's prices have been steadily raising for a while).
Also, a lot has happened in the last few years: RAM prices skyrocketed, Bitcoin mining drove up demand for AMD GPUs. However both of those have been over for a while now.
The rx480 was priced very aggressively, the $199 price grabbed some headlines (8gb card cost a little more). Given the die shrink and three years (plus the Ryzen cores doubling), you'd be forgiven for expecting the rx5700 to come in closer to $199, than the $349 (XT is $399) keep in mind that these new cards aren't much over double the performance.
While, it's no secret that shrinking fabrication is getting harder and more expensive (it's hurting Intel right now). Prices per transistor have dropped for CPUs and SSDs has dropped noticeably, even DRAM to an extent, but not GPUs...
Even demand for machine learning doesn't explain the price hike (GPUs are now being artificially handicapped, just as professional graphics have been, shifting demand to the even more expensive Tesla cards).