All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
The martyrs are of two kinds:
The first category: He who is killed while fighting to make the Word of Allaah the highest, this is what is meant by mentioning the word martyr (Shaheed). There are some rulings that apply to him in this world and the Hereafter, for instance in this world he is not washed, there is no funeral prayer for him and he is shrouded in his clothes.
The second category: The martyrs who are mentioned in the narration in the question, they will get the reward of martyrs in the Hereafter, but the worldly rulings that we have previously stated do not apply to them. The Prophet counted the people who die in other ways as martyrs to show the Mercy of Allaah. That's why he said: "Then the martyrs of my nation are but a few" as a response to the companions who restricted the meaning of martyrdom to the first type. Then he mentioned some categories of people who die that will have the same reward as martyrs, but will be of a lesser degree than the martyrs of the first category.
Allaah knows best.