"She is going to make an apple pie" - one apple pie, for example. We're not being specific here.
"Apple pie is a very American dessert." - here, we mean "apple pie" in the most general sense. You simply don't use "the" when speaking in general. As apple pie is a kind of food, we naturally follow the pattern for the uncountable noun "food".