Smart contracts get compiled into byte code that get run on the blockchain. Each instruction costs a certain amount of money. This fee is called a “gas” fee, because you need to put in enough money to execute your entire contract, which varies by how complex it is, similar to how you need enough gas in your car to drive a certain distance.