I know that it should be had + verb in past form, but not sure about these sentences:
This idea appeared when an apple had fallen on his head.
Meaning: first it felt, then an idea appeared at those moment when it felt.
Or
This pencil appeared on the table when the other one had broken.
I suppose this would be wrong:
This pencil appeared on the table when the other one became broken.
Meaning: one thing became broken and after than the other one appeared.