why is it necessary to open our eyes during namaz. What if we close them. I read in a lot of books but did not get a relevant answer
Actually the sunnah shows that our prophet () used to pray with open eyes.
Therefore scholars considered this as the best manner to pray.
Nevertheless the most essential thing in salah is "khushu' الخشوع" or what is often translated concentration in the prayer.
They who are during their prayer humbly submissive (23:2)
Therefore some scholars consider praying with closed eyes as makrooh (frowned upon) if it was done without necessity or valid reasons. And permissible if it was for the purpose of khushu'.