The brain is principally composed of about 10 billion neurons,
each connected to about 10,000 other neurons. Each of the yellow
blobs in the picture above are neuronal cell bodies (soma), and the lines
are the input and output channels (dendrites and axons) which connect them.
Each neuron receives electrochemical inputs from other neurons
at the dendrites. If the sum of these electrical inputs is sufficiently
powerful to activate the neuron, it transmits an electrochemical signal
along the axon, and passes this signal to the other neurons whose dendrites
are attached at any of the axon terminals. These attached neurons
may then fire.

It is important to note that a neuron fires only if the total signal
received at the cell body exceeds a certain level. The neuron
either fires or it doesn't, there aren't different grades of firing.

So, our entire brain is composed of these interconnected electro-chemical
transmitting neurons. From a very large number of extremely simple
processing units (each performing a weighted sum of its inputs, and then
firing a binary signal if the total input exceeds a certain level) the
brain manages to perform extremely complex tasks.

This is the model on which artificial neural networks are based.
Thus far, artificial neural networks haven't even come close to modeling
the complexity of the brain, but they have shown to be good at problems
which are easy for a human but difficult for a traditional computer, such
as image recognition and predictions based on past knowledge.