states are stored on evm and every full node has a copy of the evm. when a transaction happens everyone full node runs this transaction through evm and agrees upon a state.
Nodes store state of EVM
A reusable snippet of code (a program) which a developer publishes into EVM state. Anyone can request that the smart contract code be executed by making a transaction request. Because developers can write arbitrary executable applications into the EVM (games, marketplaces, financial instruments, etc.) by publishing smart contracts, these are often also called dapps, or Decentralized Apps.