Neurons are highly specialized cells equipped with a sophisticated molecular machinery for the reception, integration, conduction and distribution of information. The evolutionary origin of neurons remains unsolved. How did novel and pre-existing proteins assemble into the complex machinery of the synapse and of the apparatus conducting current along the neuron?"
Source : Current Biology, Volume 30, Issue 10, pR603-R616
Like many other highly specialised cells, the evolutionary path(s) which led to the existence of the neuron (enabling the development of animal 'nervous systems') are not known in detail.
The 2020 study cited above describes the extreme complexity of what is known about how neurons work, and suggests a variety of equally complex evolutionary steps which could plausibly account for neurons - whilst pointing out that :
The evolutionary threshold towards neuronal phenotypes may have been reached several times independently, in different cellular lineages, and possibly in different species.
[…]
It is clear that more data from invertebrate model (and non-model) species will be needed to complement and complete our view on neuron and nervous system evolution. To fully trace the winding paths that led to the emergence of the first neurons, once or multiple times, we need to identify and investigate neuronal and protoneuronal modules in a multitude of cell types in various metazoan phyla, and compare them at large scale, taking into account paralogy and orthology relationships of the constituting proteins.
[ Source as above ]