Automatic Market maker plays the prominent role behind the working of pancakeswap which relies on the automatic mathematical formula which replaces the order book.
The price of the assets is fixed according to the pricing algorithms. This pricing formula can vary according to the DEX PancakeSwap works on the AMM model, which means the users can trade their digital assets on the platform at any time even if their order book isn't matched with anyone else.
Instead, the trading occurs against liquidity pools.
These liquidity pools are filled with user's funds. The users deposit those funds into the pools just to receive a liquidity provider token or LP Token in return. These LP tokens can be used to reclaim shares and trading short, anyone can trade BEP-20 tokens or add liquidity to PancakeSwap and earn LP tokens as rewards.
After the popularity of this kind of food-themed platforms many entrepreneurs are willilng to kick start their own exchange and they all aware of Pancakeswap Clone Script, but they need to check out the integration of Automatic Market maker in the script then only it will work the same as pancakeswap