Ethereum uses gas to control the amount of resources that a transaction can use (computation, memory, and storage), processed on thousands of computers around the world.
The gasPrice field in a transaction allows the originator to set the price they are willing to pay in exchange for gas.