Chakra originally belonged to the God Tree. When Kaguya Ōtsutsuki ate the fruit the God Tree bore, she became the first person in history to wield chakra. With her new-found power, she ended all the wars that plagued the lands. Her sons, Hamura and Hagoromo Ōtsutsuki, were the first people to be born with chakra. Hagoromo decided to spread chakra to others through a practice called ninshū (later evolving into Ninjutsu), intending to create peace by using the chakra to connect people's spiritual energy so that they would understand one another without even talking. Until this point, Humans existed with 2 separate energies: the spiritual and the physical though neither connected to each other and formed chakra.
Since being spread by Hagoromo, chakra has become a form of life energy that all individuals produce to some degree; those who run out of chakra will die. This is because chakra is the resulting energy of mixing together physical and spiritual energy; if chakra runs out it means one was depleted of either or both and that, in itself, equals death. Produced within the "chakra coils" (basically, within the pathways of chakra) that mainly surround and connect to each chakra-producing organ, the energy circulates throughout the body in a network called the "Chakra Pathway System", which is similar to the cardiovascular system. Certain groups, such as shinobi, have learned to generate more chakra and release it outside their bodies through pressure points (or openings) called tenketsu in order to perform jutsu. Chakra is not normally visible to the human eye, though it can be seen in situations where a person releases as much of their chakra as possible. This is rarely seen due to the restrictions of eight specific tenketsu known as the Eight Gates, which limit the amount of chakra an individual can release at a single given time.
Chakra is created when two other forms of energy, known collectively as one's "stamina", are moulded together. Physical energy (身体エネルギー, shintai enerugī) is collected from each and every one of the body's cells and can be increased through training, stimulants, and exercise. Spiritual energy (精神エネルギー, seishin enerugī, English TV: Mental Energy) is derived from the mind's consciousness and can be increased through studying, meditation, and experience. These two energies becoming more powerful will in turn make the created chakra more powerful. Therefore, practising a technique repeatedly will build up experience, increasing one's spiritual energy, and thus allowing more chakra to be created. As a result, the ninja is able to do that same technique with more power. This same cycle applies for physical energy, except the ninja needs to increase their endurance instead. Some unique individuals have substantial potential that enable them to exponentially increase their chakra reserves in a relatively short amount of time.
Each person's chakra is different and as such gives off a unique chakra signature, which sensor type ninja are able to detect. Chakra signatures are passed genetically, allowing a person's clan to be identified by their chakra; over time, entire populations can have perceptibly different chakra. One's chakra signature can be altered by absorbing DNA from multiple people, mixing various chakra signatures together to become a whole new one. In the anime, chakra signatures that are similar to each other (such as that of a parent and child) are suggested to resonate when near each other. Each person's chakra also has a unique "colour" that can be seen by those with dōjutsu (the anime tends to colour all normal chakra light blue).
A chakra signature can often be described as a mixture of characteristics that can be detected in ones chakra flow. Chakra is always moving and thus "flowing" within the chakra system. This movement, this flow, has unique characteristics that vary from individual to individual, forming ones chakra identity. But its also a source of information on its owner. By perceiving ones chakra flow, it is possible to detect many things from when a person is sad, happy, lying, in pain, sick, dying, performing a technique, etc. This is very important for medical ninjas as chakra, being a ninja's life force, is intertwined within his body and well being thus changes to ones chakra are key to diagnosing problem as and issues with the ninja. Normally, where there is a lesion, injury or disease, the chakra flow will be notoriously different, aiding in finding the core of the issue. The body also tends to direct and conduct chakra to those areas, consuming it to try and heal the body.
A part from diagnosing, chakra is very important for medical ninjas because its through their own chakra and often using the patients chakra as well, that one is able to heal tissue much more rapidly than normal. By empowering and manipulating cells and various biological processes of the patients body and metabolism with chakra, the medical ninja is capable of healing, regrowing tissue, etc. Additionally, some ninja techniques inflict damage and injury on a patients chakra system and chakra directly, something the medical ninja is also able to help heal.