The rule of war that battles have to commence at/post sunrise and conclude at/pre sunset was inspired by a lot of practical considerations (like most other rules in dharma) beyond mere 'follow this because this is virtuous'.
The ancients lived in an already hostile world that became much more hostile once their only real source of light disappeared. There was fire ofc and there are records of soldiers coping with the darkness with their fire torches and oil lamps, but that can only help so much.
Men primarily identified each other(allies or enemies) by size/color/shape/design.. of their standards(dhwaja) and outfits (armor, gear), which quickly became ineffective after dark. In a battle, it’s dangerous to have people wildly swinging swords & shooting arrows in the dark without knowing who they might hit.
Another thing to consider is that battlefield itself is quite an unforgiving place to be in. Not being aided by light, you risk falling into ditches, holes, hitting rocks, stumbling, falling and getting cut/pierced by blades and arrows lying on the ground.
Night-time also means exposing yourself to the elements (wind/chill) and night crawlers - snakes, scorpions, porcupines, and also leopards, jackals, wolves, bears, etc. Very hard to defend yourself against this when you're preoccupied with a battle at the same time.
Another practical constraint I forgot to add in the earlier paragraph was that if you are carrying a fire torch, you have to free your non-dominant hand. This means dropping the weapon or the shield that you were carrying, which puts you more at risk.
Lastly, the issue of sleep which has been discussed at great lengths too. Fighting all day on the battlefield with heavy metal armor, swords, lances, bows-arrows must've already been pretty exhausting for the soldiers and letting it bleed into the night means overworking them at reduced cognitive capabilities.
The rule was mostly unviolated by either of the parties because there was significant loss to be prevented by each party if they upheld it.