I doubt there is an answer.  The Koran is a mediaeval document with many logical holes in it.  One is expected to just accept that these beings are created in heaven like angels and exist to comfort the faithful dead.  I don't think anyone is claiming that it makes sense.  Heaven doesn't exist, after all.  —