All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The voluntary prayer was prescribed to give the person a means of getting closer to Allah and to get the love of Allah.
Abu Hurayrah narrated that the Prophet said: “My Slave does not get closer to Me with anything more beloved to Me than something that I have enjoined upon him, and My Slave keeps getting closer to Me by performing Nawaafil (supererogatory acts of worship) till I love him, and if I love him, I become his hearing with which he hears, and his seeing with which he sees, and his hand with which he strikes, and his leg with which he walks; and if he asks something of Me, I would surely give it to him, and if he seeks My Refuge (protection), I would surely protect him (i.e. give him My Refuge).” [Al-Bukhari]
The voluntary prayer is also an expiation and a completion of what was not done properly while praying an obligatory prayer.
Abu Hurayrah narrated that the Prophet said: “The first thing about which the people will be called to account out of their actions on the Day of Judgment is the prayer. Our Lord, the Exalted, will say to the angels - though He knows better: Look into the prayer of My servant and see whether he has offered it perfectly or imperfectly. If it is perfect, that will be recorded perfect. If it is defective, He will say: See if there are some optional prayers offered by My servant. If there are optional prayers to his credit, He will say: Compensate the obligatory prayer by the optional prayer for My servant. Then all the actions will be considered similarly.” [Abu Daawood]
The voluntary prayer also elevates the rank of the servant in Paradise. Thawbaan narrated that the Prophet said: “Adhere to righteousness even though you will not be able to do all acts of virtue. Know that among the best of your deeds is the prayer and that no one maintains his ablution except a believer. Any prostration you perform, Allah will elevate you for it a rank.” [Ahmad and Ibn Maajah]
For more benefit on the Witr prayer, please refer to Fataawa: 82259 and 83483.
Allah knows best.