ואתם לא תצאו וגו': מגיד שמאחר שנתנה רשות למשחית לחבל אינו מבחין בין צדיק לרשע
…once permission has been given to the משחית (destroyer) to damage, it does not distinguish between a righteous and a wicked person.

2 Answers
2

The Maharal writes that although it was Hashem himself who killed the first-born, as we stress in the Haggada, permission was given to the destroyer. Usually the משחית doesn't have permission to wreak havoc on mankind. But during a מגפה the מלאך המות reigns freely.

This is alluded to in Bava Kamma, in Hakoness, that during a plague one should walk on the side of the road since the מלאך המות walks in the middle, whereas during good times one should walk in the main section to avoid the lurking מלאך המות.

So, Hashem is the one killing and He does differentiate between those whom He came to kill and the others. However, being that it was a time of plague there was free reign for evil powers to harm people indiscriminately.

According to this, נגף refers to Hashem's act while משחית is the angel of death.

Welcome to Mi Yodeya, Benny! Can you explain (by editing) how this point addresses each of the points in the question? (It's OK if it doesn't address them all, but clarifying which parts you are answering would improve your answer.)
–
yEzMay 20 at 22:28

G-d knows everything. Therefore He knows who is Jewish, who is Egyptian and exactly who is firstborn.

The ritual performed by the Israelites is not there to show who is one of them or not, but a commandment, primarily to show their commitment to being an Eved Hashem. They are switching one Avodah for a different one.

On verse 23 Rashi simply writes:

and He will not permit the destroyer: Heb. וְלֹא יִךְתֵּן, lit., and
will not give. [I.e.,] He will not grant him the ability to enter,
as in “but God did not permit him (נְתָנוֹ) to harm me” (Gen. 31:7)

Of course G-d can distinguish but this night in particular there is a certain miracle to take place, in which, at exactly midnight, all the Egyptian firstborns will be struck dead in one moment. Therefore nobody else will die that night, even those who normally would have done by the normal force of nature. This may be the meaning of not letting the destroyer to enter... Not even to take the lives of those who normally would have died that night.