The reasoning is that if the bier is carried away before he has finished, he may still supplicate for the deceased even in his absence, out of necessity.
However, the scholars of the madhhab qualified this, saying, “Unless he fears that it will be carried away.” That is, if he fears it will be carried away, he follows the imam in the takbīrs and gives the salām.
Ordinarily, in our funeral processions, the bier is carried away, and they do not wait for people to make up what they missed. Accordingly, he follows the imam in the takbīrs and gives the salām.
Despite this, they said, “He may give the salām with the imam,” because the obligation has been discharged by the imam’s prayer. Whatever remains after the imam’s prayer is regarded as voluntary, and a voluntary prayer may be discontinued.
It was also said: Rather, he should make it up in its proper manner. The evidence is the Prophet’s saying, peace and blessings be upon him: “Whatever you catch, pray; and whatever you miss, complete.” (1) This entails that he must complete it in its proper manner.
Thus, there are three cases concerning the latecomer in the funeral prayer:
First: he is able to make up what he missed before the bier is carried away. In this case, he makes it up, and there is no difficulty in this, due to the general purport of the Prophet’s saying, peace and blessings be upon him: “Whatever you miss, complete.” (2)
Second: he fears that it will be carried away, so he follows the imam in the takbīrs, even if he offers only a brief supplication for the deceased.
Third: he gives the salām with the imam, and the remaining takbīrs are waived for him.
The reason for this is that the obligation has been discharged by the imam’s prayer; thus, he has the choice regarding what remains.