Well huawei ban bought samsung sometime, scared PRC brands from expanding into north american market. TBH Samsung was still pretty dominant until PRC brands really turned dial on hardware while Samsung stagnated until they couldn't. The latest round of hardware is pretty good, as in PRC flagship parity worthy. TBH the Koreans are very talented, they don't have the numbers to keep up with PRC speed / product cycles, but if they can iterate proper flagship every other year, they'd be in a good place. Also not putting ads on fridges.
Sure, I'm actually old enough to remember Huawei's Ascend sold under MetroPCS in the US back in the early 2010's. Leica collaboration with Huawei in 2016 worked wonders and other Chinese smartphone makers definitely stepped up, but, by this time, Samsung's China sales fell off the cliff by ~70+% to a low single-digit market share from its 20% peak in 2013 under Xi's "In China, For China" campaign.
Not sure if Huawei was ever a threat to Samsung or Apple outside China as most of Huawei's growth was in China only and there was no other single major market in which Huawei came close to Apple's or Samsung's. China is also the only major market where Samsung's market share is less than 1% and I'm very disinclined to believe this is coincidence. I think the common misconception is that Samsung was "outcompeted" by Huawei when it was in fact forced out of China. This practice became quite common in other industries too after Xi -- eg, all foreign competitors in EV batteries business such as LG, Panasonic, Samsung, etc were also effectively banned in China under Xi's Made-In-China 2025, launched in 2015 to protect local "champions," such as CATL/BYD.