There are several possible reasons why a cat might be getting thinner:

The cat is infected with parasites. Parasites can steal nutrients from a cat, causing it to become increasingly thin, and it may also experience symptoms such as diarrhea.
Malnutrition. A monotonous diet or a long-term diet of poor-quality cat food can lead to malnutrition in cats.
Having chronic diseases, such as feline infectious peritonitis, leukemia, uremia, and tumors, can all cause a cat to become increasingly thin.
Insufficient sleep and psychological problems. Insufficient sleep in cats can affect their metabolism, worsen their mood, cause anxiety, and affect their appetite.
Other possible causes include gastroenteritis and hairballs. If your cat is unwell, please take it to a veterinary hospital for examination and treatment as soon as possible.