This is a complex question because there are subtleties, but ignoring those, the present perfect has a "perfected aspect."
I have done my homework
I was doing my homework
both relate to the past, but the first indicates completed ("perfected" in an old-fashioned sense) action, whereas the second does not indicate completion.
The primary distinctions between simple past and past perfect relate to recency, current relevance, and specificity.
If there is a specific marker of time, you must use the simple past.
I did my homework more than an hour ago.
indicates completion in the past: it has perfected aspect, but it is specific about time.
I have already done my homework
indicates completion in the past: it too has perfected aspect, but it is vague about time although it implies that it is relatively recent.
You can also use the these two tenses to indicate continuing relevance or its absence.
I lost my car keys and wasted an hour looking for them
I have lost my car keys and need a ride home.
In the first sentence, the simple past is used because there is no current relevance to that loss. In the second sentence, current relevance is the whole point.
Finally, there is an implication of relative recency when using the present perfect; that is the "present" dimension.
I have finished my term paper
implies that you finished it recently.
I finished my term paper
implies that you finished it some time ago. Unfortunately, "recency" is not a strictly defined term. It primarily depends on context. For more on that issue, this may help.
How to define the recent past: how recent is recent?