A stable coin is obtainable only through the DEXes. In the DEXes stable coins are paired with Bitcoin.
Before every swap between BTC and Stable coin, the stable coin itself checks the price of BTC, and mints for itself that amount of token. After the swap, Stable coin mints tokens to rebalance its assets.