Why didn't Coca-Cola apply for a patent?

The protection period of a patent is only 20 years, and it needs to be made public to the extent that those skilled in the field can repeat it. Twenty years later, this technology will enter the public domain and everyone can use it. It is more effective to protect the formula as a trade secret, provided that reverse engineering is difficult and the secret can be kept.