A smart contract is a program living at an address on chain. Send it a transaction and it runs deterministically, and every node independently verifies the result, so no party has to be trusted to perform.
This is what makes decentralised lending, trading and stablecoins possible. Collateral, interest and liquidation rules are enforced by the code rather than by a counterparty who might refuse.
The code is the whole agreement, bugs included. Hundreds of millions of dollars have been drained through flaws in deployed contracts, and because the chain executed exactly as instructed there is no operator to appeal to. Audits reduce this risk and do not remove it.