Well it depends on what stablecoin it is, and it could be complicated as @cryptokid says, but in short there is custodial stablecoin like USDT, USDC, and USDP. They are basically pegged to the dollar under the assumption people trust that it is backed by the similar amount of dollar asset + sometimes some government bonds.
On the other hand, there is DAI stablecoin which is known as an algorithmic stablecoin and by nature it is non-custodial because it is backed by assets stored in a smart contract instead of an institution. Now there are many variation of algorithmic stablecoin, but most of the existing one issued are basically more like a debt/derivative asset because the value of the stablecoin is derived by the stored asset like ETH in the smart contract as collateral. Of course in the case of asset price going down, those collateral can be liquidated.