When a cat rolls around and rubs its head on the ground, it usually means one of the following:
Expressing happiness and relaxation: When cats feel very happy and relaxed, they may express their emotions by rolling and rubbing on the ground. This is because rolling and rubbing helps them release energy and demonstrates a state of pleasure and contentment.

Marking territory: Cats are territorial animals and like to mark their territory in various ways, including rolling and rubbing against the ground. By leaving their scent, cats let other animals know that this is their territory and warn them not to approach.
Attracting attention: Sometimes cats roll around and rub against the ground to attract their owner's attention. The cat may think that this behavior will get the owner's attention and receive more attention and affection.