Targum Pseudo-Yonatan elaborates:
But two men had remained in the camp; the name of the one Eldad, and the name of the second Medad, the sons of Elizaphan bar Parnak, whom Jokebed the daughter of Levi bare to him when Amram her husband had put her away; and to whom she had been espoused before she gave birth to Mosheh. And the Spirit of prophecy resting upon them, Eldad prophesied, and said: Behold, Mosheh shall be gathered from the world; and Jehoshua bar Nun, the minister of the camps, will be established after him, and will lead the people of the house of Israel into the land of Kenaan, and make it their inheritance.
Medad prophesied, and said: Behold, quails come up from the sea, and cover all the camp of Israel; but they will be to the people (a cause of) an offence.
And both of them prophesied together, and said: Behold, a king will arise from the land of Magog, at the end of the days, and will assemble kings crowned with crowns, and captains wearing armour, and him will all nations obey. And they will set battle in array in the land of Israel against the children of the captivity; but already is it provided that in the hour of distresses all of them shall perish by the burning blast of the flame that cometh forth from beneath the Throne of Glory; and their carcases shall fall upon the mountains of the land of Israel, and the wild beasts of the field and the fowls of the sky shall come and consume their dead bodies. And afterward will all the dead of Israel live (again), and be feasted from the ox which hath been set apart for them from the beginning, and they shall receive the reward of their works.
The prophecy of Eldad and Medad made its way into Pseudepigrapha, though whether the 400 line work (no longer extant) parallels these prophecies is a question. But the spark for this is certainly, in part, the words veHeima baketuvim. It leads the way for such writings to be produced. How each of the details of these midrashim arise from Biblical text, if they do, is also an interesting question.
I'll try to point out a few interesting parallels, though noting up front that this is all my speculation. Thus,
Behold, Mosheh shall be gathered from the world; and Jehoshua bar Nun, the minister of the camps, will be established after him, and will lead the people of the house of Israel into the land of Kenaan, and make it their inheritance.That Moshe shall be gathered from the world -- pasuk 30 states that
This means that he was gathered. I did not raise that point last time I discussed it, but I raise a whole other bunch of connections. See there.
In terms of the prophecy of Eldad and Medad together, it parallels, point by point, Yechezkel's prophecy in Yechezkel 38 and 39. As an exercise, read through those psukim and find each point in there. Maybe I will do so in a later post, or perhaps not. Perhaps since it was an unspecified prophecy, and it is in the ketuvin, there was this impetus to ascribe an apocalyptic prophecy to them.