Gwei is just a smaller denomination of Ether, at 1X10-9 ETH. A wei is the smallest unit of Ethereum you can have, at 1x10-18 ETH.
Ether is used to purchase Gas, which is required to run smart contracts and submit transactions to Ethereum. Gas is the primary method through which miners processing smart contracts get paid.
Each instruction sent to the Ethereum Virtual Machine to process a transaction or smart contract costs a specific amount of Gas. If the required amount of Gas is not provided to the transaction, it will fail before completion.