Smart contracts

I've been trying to understand what is a smart contract. According to the GitHub post, the ELI5 version is that you're basically paying a bunch of computers on a network to process a piece of code that you send to it. I think you can think of it similar to Amazon's AWS but runs on more basic code. The costs to run a smart contract varies with the price of gas, which is paid in ETH.