The cat tongue, like the human tongue, can taste four general categories: saltiness, sweetness, sourness and bitterness. Cats’ favorite tastes are salty and/or sour, and they definitely do not share humans’ (or dogs’) love of sweet things. But there are curious exceptions to every rule.
In spite of being carnivorous, and in spite of what was just said about sweet foods, some cats like sweet tastes, especially floury sweet objects like cookies. (Note that cookies and other sweet treats like pastries do have fat in them, and it’s likely that the fat is the draw, not the sugar.)