They both priced higher, Nvidia priced higher so they could sell through their warehouses of older cards for more money, I think Jensen called it layering when openly telling shareholders this was the plan. AMD followed along and did the same despite having a real opportunity to snatch market share and put Nvidia in a really difficult position with huge supplies of unsellable 3000 series cards. AMD is now having to cut pricing as no one was buying their cards for their MSRPs while Nvidia can just stick for now and make do with the low sales as they can funnel the same silicon into AI products and sell for far more.
AMD are not cutting prices to do you a favour and would be more than happy taking 900 quid off you for cards like the 7900XT but because they are not as heavily invested in AI as Nvidia they need some gaming sales so the price cuts are to get stock moving, again this isn't a move to undercut Nvidia as Nvidia right now couldn't care less about gaming. AMD are simply lowering prices to try and maintain an acceptable level of sales which is why I fully expect cards like the 7900XT to be down to around £600 by the end of the year.