I must admit that, as an Italian, I am not sure about the difference between “cake” and “pie” (apart from specific cases). In fact, I find the two images quite similar and both look like particular kinds of torte, while there are other torte that are much more different than those two differ between them.
It so happens that different languages partition concepts in different ways.1 I understand that for an English speaker “cakes” and “pies” are clearly different concepts, while they are all torte for an Italian, just like Italian scimmia means both “monkey” and “ape”. There are lots of examples the other way around too, of course. For instance, an English “cup” corresponds at least to the distinct Italian words and notions of tazza, tazzina, coppa and sometimes to bicchiere too; or take “helmet”, which can correspond in Italian to elmo, elmetto or casco, and so on. (And I don't even mention, say, the several Italian words for what abroad one would simply call pasta.)
To go back to torte, of course there are in Italian several names for specific torte: crostata, pastiera, millefoglie, sbrisolona...
1 Here we are skirting the Sapir-Whorf hypothesis.