This is a very common attitude in cats and can have different meanings. It is therefore important that the owner knows how to decipher the meaning. This behavior can indeed mean various instinctive needs. This is what we will see here.

Period of heat
During her periods of heat, the cat tends to roll on the ground. But it is an attitude that males also adopt when a cat in heat is in her environment. This is simply the way these animals deposit pheromones on the ground. These are signals that they send to each other because the pheromones, thus propagated, allow each of them to know that the time to mate has indeed come. It is in the owner's best interest to keep his cat at home if he does not wish to raise a litter of kittens.
Need for attention or want to play
The cat will roll around on the floor under his owner's tender gaze in order for his charm to work. This is a form of body language. In this way, the animal is trying to let its owner know that it is bored or wants to be taken care of, or even that it is time to have some fun. Cats love to play with their foster family members, both young and old. So don't deny him this interactivity, which promotes exchanges and keeps the little feline's brain active.
In any case, the cat knows very well how to insist when he wants something. He would be very surprised if he was no longer the center of the world in the eyes of his master... In the absence of reaction from the latter, the animal is capable of placing himself in a strategic place in order to make sure that he can really be seen, and to resume his rolls on the ground until his master finally allows himself to be touched.
Relieving an itch
Just as a horse rubs its neck against a tree trunk to scratch itself, sometimes a cat will roll on the ground to relieve itching, especially on its back and especially between its shoulder blades, which it has a hard time reaching when it grooms itself despite its innate flexibility. When this behavior occurs frequently, it is necessary to check if the little feline is not infested with parasites (fleas). In case of doubt, you can administer a flea lotion and take the opportunity to brush his coat carefully. If the kitty has nothing against a good bath, you should not deprive him of it...
Eliminate his dead hair
Even if it does not do it knowingly, by rolling on its back, the cat eliminates a large quantity of dead hairs. This is a reassuring behavior because all this hair left on the ground will not be ingested when the cat licks itself.
Marking its presence
By rolling around on the floor, the cat may simply be indicating its presence to other cats by scenting the floor. This is part of a cat's ritual to mark its territory.
The cat is in a trance
A cat can be seen to be in a sort of trance when it sniffs catnip (Nepeta cararia), the euphoric herb more commonly known as catmint or catnip. It has a real attraction for kittens. They roll around on the ground in a state of extreme bliss.
Looking for freshness
It is common to see your cat rolling around on the kitchen floor, for example, because it is too hot. This is a way for him to cool down. During the summer, it is not uncommon for him to roll on the sand or pebbles of the driveway, or even on the terrace when these places are particularly shaded.
This is usually a normal behavior for cats. Of course, if it goes on for hours and days, it's best to talk to the vet. It is then important to note the duration and the seniority of this type of behavior as well as any other indication being able to put the practitioner on the way (undergone slimming, diarrhoeas, etc). At the slightest doubt, he will submit the cat to additional examinations (blood test, urine analysis, X-ray). But in a cat, rolling on the ground is not among the symptoms of a particular pathology.