"Perfect", gramatically speaking, means "past, completed", althought we don't always use them that way. But, simply:
Present perfect for an action that has happened in the past (before now): I have eaten there before; I have always enjoyed his company; I have finished my homework [the exact time of the action cannot be mentioned, as it may with the simple past].
Past perfect for an action that occured before another related past action: I had eaten before they arrived; I had always enjoyed his company before he insulted me; I had finished my homework by the time my favorite TV show came on.