Schopenhauer, Arthur - The World as Will and Idea - An erection is a motive, because it is an idea
Type of Spiritual Experience
Every aggregate has its own system.
In effect if we use the software analogy, each thing gets a package of software - a set of programs [functions] that enable it to do various basic things.
It may subsequently learnt to do other things, but at birth this set of programs gives it a start and more or less defines what that species 'is'.
A description of the experience
The World as Will and Idea – Arthur Schopenauer
The bird of a year old has no idea of the eggs for which it builds a nest; the young spider has no idea of the prey for which it spins a web; nor has the ant-lion any idea of the ant (his prey) for which he digs a pit for the first time.
In the timber in which it is to await metamorphosis, the larva of the stag beetle makes the hole twice as big if it is going to be a male beetle as it does if it is going to be a female, so that if it is a male there may be room for the horns, of which, however, it still has no inkling.
In such activity the will [meaning software] is clearly operative, as it is in the other actions of these creatures, but this is blind activity which, while accompanied by knowledge, is not guided by it.
Once we have understood that idea as motive is not a necessary and essential condition of the activity of the will, we shall more easily recognise the activity of will in cases where it is less apparent................
..... the rising of the sap in a plant occurs as a response to stimulus and cannot be explained from mere causes, according to the laws of hydraulics or capillary attraction; yet it is certainly assisted by these, and by and large it is very close to a purely causal change.
On the other hand, the movements of the (honeysuckle like) Hedysarum gyrans and the Mimosa pudica (whose leaves fold when touched) although still resulting from mere stimuli, are very like movements which result from motives, and seem almost to want to make the transition. The contraction of the pupils of the eyes as the light increases is due to stimuli, but it passes into movement which is due to motive; for it occurs because light too strong would painfully affect the retina, and to avoid that we contract the pupils.
The occasion of an erection is a motive, because it is an idea, yet it operates with the necessity of a stimulus; that is to say, it cannot be resisted, but we must banish the idea in order to render it ineffective.