There are various mechanisms for doing this. A company can continuously innovate to keep a step ahead of their competition. A company can master manufacturing to beat competitors on cost alone. A company can rely on brand loyalty to maintain customer even in the absence of compelling innovation or cost advantages. One legal form of protection is afforded through patents, trademarks, and copyrights.
Some companies choose to protect their intellectual property by maintaining trade secrets.
The Coca-Cola formula is a famous trade secret. An essential part of any business plan is to determine the size of a potential market. For your product, perform a preliminary market analysis. List product selling prices and major features.