Gas is the internal unit of cost to run a code on the Ethereum Virtual Machine (EVM). Like electricity is metered by kilowatt, computational power on Ethereum is metered by gas. Gas cost is paid in Ether.
In the Ethereum Virtual Machine each operation has a cost. The more complex the operation the more computational power and storage it requires. In order to execute a smart contract on EVM you need to pay for every single instruction that is coded in the smart contract. The cost for each computational operation is measured in the unit called gas.
On Ethereum running a smart contract is considered as transaction. Miners get the reward in Ether for processing the instructions or transactions. The other reason why Ethereum charges a fee for computational steps is to prevent the network from wasteful spam transactions, but also without a fee miners would have no incentive to process a transaction.