Graphite is a dark grey dry powder lubricant used in lock cylinders and locks so the key goes in and turns smoothly. As it is not greasy, it does not trap dust or sand.
It is applied by puffing a little into the cylinder, through the keyway, and putting the key in and out several times to spread it. It is also sold as a pencil and as a spray.
It is the very opposite of oil: oil and grease form a paste with the dirt and over time seize the cylinder, something very common on the coast. A small amount is enough. If the lock is still stiff afterwards, the problem is something else and it is worth having it checked. More under lock repair.