Contracts live on the blockchain in an Ethereum-specific binary format (EVM bytecode) that is executed by the Ethereum Virtual Machine (EVM).
The compiled EVM code is sent off to the blockchain with a contract creation transaction while the additional metadata created as part of compiling a smart contract will ideally live on the decentralised cloud as publicly verifiable metadata complementing the code on the blockchain.
In the process of deploying a smart contract, we are actually sending a transaction to the empty address with the EVM code generated as part of compiling the smart contract as data of the transaction.
After some time, your transaction should appear included in a block confirming that the state it brought about is a consensus. Your contract now lives on the blockchain at the address created for the smart contract.
Contract addresses have bytecode associated with them and there is no one externally controlling the private keys behind the contract. Contracts keep a CRAB log instead of a CRUD database (Create read append burn vs Create read update delete).
As we have the code of smart contract part of the data of the transaction that created the smart contract and also we have the new address for the smart contract, Ethereum blockchain can actually find out the actual byte code to be executed by searching for the first transaction that has the output pointing to the contract address.