A couple of different things. Yes, as @Mijin cited, Starbucks is struggling, but is still doing fine in terms of overall profitability and penetration. But they absolutely took major self inflicted wounds in killing their in-store shopping because the prices are high enough to make you wonder why you’re paying so much if ALL you’re getting is the drive-thru coffee model they were pushing. Thus, they’re redirecting traffic back inside, offering “inside” ceramic mugs, and other options… but no, the comfy chairs of the past are gone, as are the days of opening a Starbucks down the street from another location!
I’m seeing two main styles in competition, though at least one of them is far from any sort of cafe definition. Mostly it’s the local, locations, which do what Starbucks does, but are agressively selling their part of the community, non-chain status. Many of which have their own internal or bespoke roasters which they proudly display. You’re getting a hand-crafted drink from a barista, but… they aren’t fast, and they aren’t really cheaper than Starbucks. So small, local, loyal followings, but at least half of the ones I knew died during Covid.
The second, and more successful option in some ways is the dedicated drive-thru only option, smaller than even a food truck, and often smack in the middle of some otherwise half-used parking lot. These places seem to do a good bit of business, and are generally cheaper than Starbucks, while still being pretty fast. But the coffee can be really uneven.
But I don’t think Starbucks is going to be losing anytime soon. Sure, they can and should close some of their excessively close locations, and I think the day and age of having a coffee shop (Starbucks or not) in every grocery store should fade away - but given the name recognition, the adequate (if you like that sort of thing) quality, and the corporate options in terms of funding and nationwide marketing, the local places are never going to compete for the same market.
Note - this is a market Starbucks has largely created for itself, with giant, super-sweet drinks that you slam down. I’ve been to a Dunkin’, and while they’re aggressively parroting the trends (same sort of drinks, especially frozen-frosted ones) at a slightly cheaper price, I never see a large number of young people there. Some, sure! But I think they’re chasing a model that Starbucks is already trying to modify, and that’s generally not a winning plan.