In English you say "I like cats" and "I like *the* cats" could be said only about some specific cats from the context of a discussion.

In Spanish it's "Me gustan los gatos" but these are cats in general. Another popular example is using "la gente" when talking about general trends in the society.

At the same time, it's similar to English in cases like "Soy músico, escribo canciones."

What is the rule here?