This is quite a hard thing to understand at first, but the main difference between both is that compound tenses express an action that has happened before another action, but does not necessarily have to be finished. It sounds a bit complicated, but it is quite similar to English grammar. It is easier to understand with an example: If you use the Pretérito Imperfecto tense (past tense and simple) and say "Yo comí un bocadillo", it means you ate a sandwich and that action is done, without having any effect on the present. However, if you want to say that you have eaten a sandwich but you are still hungry, you would say "Yo he comido un bocadillo pero sigo teniendo hambre": the action has finished but it has an effect on the present, because you are still hungry despite having eaten. Note how in both English in Spanish you use simple and compound tenses in the same situations. This is not always the case, but the correlation is there most times, so in case of doubt, just think how the sentence would be in English and find the Spanish tense that corresponds to it. This is a very common issue but it will eventually come naturally without having to think in English first!