How does one happen to write a poem: where does it come from? That is the question asked by the psychologists or the geneticists of poetry.
If you talk to geneticists they are constantly finding that your genes are being switched on and off because of the environment. Genes alone do not determine an exact path in your life.
One would have to have completely forgotten the history of science so as to not remember that the desire to know nature has had the most constant and the happiest influence on the development of mathematics.