Animals generally adopt a herbivorous or carnivorous lifestyle. Choosing to eat grass and plants requires nearly constant foraging because of its low nutritive value and an expanded or extra stomach to ferment the grass by bacteria to make it digestible. These animals need to be on constant alert to look out for nocturnal predators and thus sleep very lightly and gingerly, have grinding teeth, a keen sense of smell and eyes located on either side of the head to give them a greater panoramic view to avoid predators like lions, tigers etc. The carnivorous predators also have a keen sense of smell, eyes in front of the head for stereoscopic vision and sharp teeth to detect, pounce on and tear the flesh of prey (deer, antelope, zebras etc.). They sleep securely but there are exceptions like dolphins. They are mammals who live in the water, but have to surface to breathe air through lungs as they lack the gills present in fish. They would drown and die if they didn't come up for air, so they sleep with only half their brain and keep alternating one of their two cerebral hemispheres between sleep and wakefulness.
In non-vertebrates like flies, earthworms etc, the body-plan and control of the nervous system is ipsilateral or same- sided. The determination of front and back (ventral and dorsal) in the developing insect embryo is by genes called 'short gastrulation' and 'decapentaplegic' respectively. The corresponding genes with similar genes in vertebrates are called 'chordin' and 'BMP4'. The unbelievable but true difference is that 'chordin' determines back or dorsal and 'BMP4' determines front or ventral. This reversal of action locates our spine and nervous system near the back in us and in the front, near the belly in insects. Michael Kinsbourne has proposed that some chordate (animal with a backbone) flipped its 180 degrees and reversed front and back. Incidentally another curious thing happened along the way of the evolutionary forum. The brain control of body and limbs became crossed, so in all vertebrates the right side of the brain controls the left body and limbs and vice versa. This is accomplished during embryonic development by the crossing of ascending and descending fibers, which mostly occurs in the medulla (lowest part of the brainstem roughly at the junction of skull and neck).
The story gets more complicated and interesting. The optic nerves also cross at the midline called the chiasm. In fish, chickens and animals with eyes on the side of the head and lacking binocular vision, all the fibers of the left optic nerve cross at the midline and go the right occipital cortex at the back of the head and those from the right optic nerve cross to the left occipital cortex. For those animals with eyes in the front of the head and overlapping fields of both eyes the benefit is stereoscopic vision that allows a frog to protrude its tongue to just the right distance to catch a fly in front of it. To best utilize this new faculty, the fibers not from the whole eye but from corresponding fields of vision from each eye must go to the same destination. Thus the fibers from the right field (temporal) of the right eye and the right field (nasal) of the left eye must go to the left occipital cortex and vice versa. This means that only the nasal fibers from each eye should cross at the chiasm and the temporal fibers of each eye should not cross to give stereoscopic vision. For non-stereoscopic panoramic vision all the fibers from each eye should cross. Life would be simple if all animals at all times follow a single life form and lifestyle. There are amphibians with two-stage lifestyles as the prefix 'amphi' in their name suggests. Frogs begin life as tadpoles with eyes on the side and end up as frogs with eyes in front of the head, stereoscopic vision and predators of insects.
Caesar crossed the Rubicon in defiance of the legal limits set by the Roman Republic and the Chiasm (crossing) of the optic nerves is such a Rubicon. How is this transformational change in wiring between the optic nerves of a tadpole and frog accomplished? During development in the tadpole each retinal neuron develops an axon with a growth cone that migrates towards the chiasm and all cross. As the tadpole develops into a frog, new neurons and new axons with growth cones develop and migrate to the chiasm. This time only the nasal fibers from each eye cross and the temporal fibers from each eye do not. At the chiasm a gene is switched on that secretes a protein called Ephrin B. Of the incoming fibers at the chiasm, only the temporal fiber axonal growth cones turn on a gene, which expresses a receptor on the growth cone, which is repelled by the protein Ephrin B. The temporal fibers from each eye are deflected away from the chiasm and proceed to the same side. The incoming nasal fibers from each eye do not express the receptor and ignoring the signals from Ephrin B cross over to the opposite cortex. It is the differential and altered timing of the turning on of genes that determines the shape, form and connections. This is why roughly the same number of genes with over 95% commonality still results in a huge difference between apes and humans.
There is a family of genes whose proteins play the role of traffic cops during the migration and connectivity of the trillions of growing axons. They are called Netrins, Ephrins, Semaphorins and Slits. Netrins attract and the others repel. Some other axons have to cross and have to be prevented from re-crossing and follow there crossed path only as far as their rendezvous point. This feat is accomplished at times by turning off the gene for Slit receptor, called Robo and thus crossing by ignoring the Slit protein. Having crossed they reactivate the Robo gene and thus express a receptor that prevents re-crossing. The stoppage of further movement is achieved by switching off other genes called Robo2 and Robo 3 when the axon arrives at its destination. The making of human or other creatures is a matter of exquisite timing by genes, the master chefs. The story is reminiscent of the Exodus, where everyone is allowed to cross the Red Sea under the guidance of Joshua's traffic cops, but even Moses, the liberator is forbidden to cross over to the promised land for lacking the outward manifestation of the covenant with the Great Traffic Controller and Designer at the fork in the road to destiny.