AMD benefited greatly from Intel's self inflicted wound: laying on their laurels thinking the leverage they had with OEMs and inertia will carry them through the hard patch like it did in their P4 times.
Intel stopped advancing in 2014-2015 for a long time. They flopped on the fabrication side, they stuck to the 2-4 core CPUs and charged an arm and a leg for anything with more than that. This gave AMD an opening with their cheap and yet still decently fast higher core count CPUs.
AMD was held back by their fabs, breaking off from global foundries did so much from them too
Also, they spent a long time suppressing AMD by bribing, and strong-arming their partners during the first cycle of AMD beating Intel (Athlon series): https://www.eetimes.com/intel-accepts-order-to-stop-unfair-t... Later on: https://www.rbbecon.com/news/article/commission-imposes-e106...