If you think that the two events occured at the same time in the past, you can use past simple twice:
He got this idea when an apple fell on his head.
If you think that the idea was after apple, you can use past simple and past perfect:
He got this idea after an apple had fallen on his head.
and the later also in:
This pencil appeared on the table after the other one had broken.
To connect two clauses in the past simple, you use "when,when, and to connect two clauses from which one is in the past and one before past (past simple and past perfect) you use afterafter or before.before.
Source: https://www.englishpage.com/verbpage/pastperfect.html