People don't go to Starbucks because it's the best, they go to Starbucks because mocha frappucinos in Lima and London taste exactly the same. Any divergence, even an infinitesimal one, makes the frap feel fake.
Which can be done, but it is a long process. Most attempts only get a fraction of the big brand, and the exceptions generally have more to do with the failings of the big brand than the competition. Once people find something they like, as long as that thing doesn't do something stupid they won't be in a hurry to look at the competition in general. If there is any switching cost they are even less interested in trying something else. Which means that the not number one competitors need to be perfect in everything - which is hard when they are not getting as much revenue to begin with, and thus cannot afford to try out any seemingly good ideas that turn out bad only after you try them...
Sure, marketing is important. But the "secret" ingredient is coca leaf extract. The actual cocaine is used to make various drugs by a different corporation.
According to Business Insider, the beverage company has a deal with the Drug Enforcement Administration to get coca leaves so that the world can get its Coca-Cola fix. The DEA lets Coca-Cola import coca leaves from Peru and Bolivia in order to get the part of its secret recipe, which it hides behind the term "natural flavors" on the ingredients list.