The definite article is used before nouns that refer to the thing in general (aka generic nouns). In this respect, Spanish is completely different from English. (A New Reference Grammar of Modern Spanish 6th Edition)
Abstract nouns:
democracy > la democracia
Catholicism > el catolocismo
Countable nouns:
Tigers are dangerous animals. > El tigre es un animal peligroso.
My favorite food is pizza (in general) > Mi comida favorita es la pizza.
My favorite food is hamburgers (in general) > Mi comida favorita es la hamburguesa.
I don't think "my favorite food is everything" is grammatical in either language, but it's certainly nonsensical. It should read "I don't have a favorite food" but regardless it is probably fine in a humorous or informal context.