It is not a “rule” or even usual that “when two incidents happen in the past one after another we use past perfect tense”. On the contrary; in a narrative of past events we ordinarily cast all events in the simple past:
Sarah showered and changed into her nicest clothes. She dined at the little Greek restaurant down the block, and then called a cab. Traffic was heavy and she arrived at the theatre a little late.
We use the past perfect when in the course of a past narrative we wish to mention an event which occurred before the point our narrative has currently reached.
... Traffic was heavy, and when she arrived at the theatre, the play had already begun. She stood at the back of the auditorium until the first intermission, and then took her second-row seat.
Which construction you use, simple or perfect, depends on when the event you mention occurs relative to your current standpoint: your ‘reference time’ (RT), the time you are talking about. Simple constructions are used for events at RT, and perfect constructions for events which occur before RT.
A participial clause has no tense of its own—it ‘borrows’ its time reference from its head clause—but it works the same way. If the event it presents takes place at RT, we use a ‘simple’ present participle:
We retired at sundown and rose at dawn for a hurried breakfast. Starting early, we made good speed in the cool morning air and arrived at noon.
But if the event takes place before RT, we use a participial perfect:
We retired at sundown. The next day we made good speed in the cool morning air, and having left early we arrived at noon.
Generally speaking, only the first verb in each clause is finite:
They knew what it meant.
Here, know is the finite verb. It changes form to agree with the subject (I know, she knows) and to indicate tense (They know, they knew).
To turn this into a question, we need to apply Subject-Auxiliary Inversion. But to do that, we need an auxiliary, so we add the dummy auxiliary do:
They did know what it meant.
Did they know what it meant? ← did and they are inverted
Now do is the finite verb. It changes form to agree with the subject (I do, she does) and to indicate tense (They do, they did). The second verb, know, is non-finite and does not change form.
*Did they knew has two finite verbs and is ungrammatical.
Best Answer
Do employed as an auxiliary always requires the infinitive form of the following verb, not a tensed form.
This can be difficult to detect because the only English verb whose infinitive form is distinguishable from its 'plain' present-tense form is be, and in practice there are very few occasions for using do be. But consider:
Both have been and had been are valid English constructions; which you employ (if either) will depend on context. This has been addressed here on many occasions; you may consult questions tagged present-perfect, past-perfect and [perfect-constructions], or the canonical post What is the perfect, and how should I use it?.