It's sort of riding a perfect storm. They've been on an upswing since the pandemic, along with the rest of the market segment, and health/wellness products in general. as more people in general have seen drinking more water as a worthwhile-to-improve aspect of their health. Their top-tier performance at less-than-Yeti prices, helped them hit a valuable niche in the market. Stanley's strategy of making them in lots of attractive colors also helped. Whoever their color experts were earned their paychecks.
Then there was a pretty popular online store that has a very popular social media presence that focuses on fashion and "lifestyle" products. They saw some potential for the product they liked so much and had been writing about, and then they bought thousands of them to push themselves through their website and social media presence. Stanley caught wind of this, and paftnered with them to started leveraging other influencers with their marketing dollars, and sales started a steeper upward trend.
But the biggest kick in their sales trajectory: there was a highy publicized series of events where a serious car fire basically destroyed someone's car, but a viral photo showed their vubrant orange Stanley, in the center console cup holder of the burned-out black car interior, which had survived survived and still contained ice cubes. Stanley, very publicly, bought that person a replacement car, which bought them a LOT of press.
Even before the fire, though, people were already treating them as their whole personality, and even collecting them like the way some people collected Funko Pops or any other collectible. A whole branch of meme culture took hold where people joked about being obsessed with them...while absolutely being obsessed with them.
People started tracking specific colors and collectors/speculators started assigning higher value to some popular/rare colors, which then drew more people in.
And then of course scalpers got involved, creating artificial demand for new colors that arose from collaborations like recent ones with Target and Starbucks.