The area between the eyebrows, where you apply chandanam (tilaka) is the spot of ‘agna’ chakra. In yogic science, this chakra or energy channel, often called as the third eye is considered as one of immense power. The third eye signifies a point of awakening and is usually activated when you pursue spiritual sciences. This is also one of the reasons for wearing a bind or tilak.
The third eye represents your subconscious mind and various thought processes. Negative energy in the form of negative thoughts enters your body through this chakra. When you apply chandanam, you block the negative energy from entering the body.
The most common reason for insomnia is an overactive mind, mental stress and fatigue. Ayurveda believes massaging this spot with chandan can relieve stress and insomnia.
The ‘magic’ ingredient, chandanam, or sandalwood is popular for its cooling properties. It not only benefits the skin but also cools the nerves below it. In a hot tropic country like India, applying sandalwood on your forehead can help cool your entire system.
Origin of this practice is unclear. But, in ancient times, when the Varna system predominated, people used to apply tilaks differently that represented their Varna. Brahmins applied a white chandanam mark signifying purity. Kshatriyas wore a red tilak that signified their valour. Vaishyas wore a yellow (usually turmeric) tilak which signified prosperity as they were traders. The Sudras applied a black tilak representing their service to all the above three Varnas.
But later, the tilaks were used to denote which Sampradaya one belongs to. The worshippers of Lord Vishnu wore a tilak in the shape of ‘U’ (also called Naamam). The worshippers of Lord Shiva wore Bhasma/Vibhuthi in three horizontal lines (also called Tripundra). The lines and the color used may vary from region to region and from sect to sect.
The area in which the mark is applied is between the eyebrows, called the Ajna Chakra. This is the point that most schools of Hinduism consider the entry and exit point of our jivaatma (soul). Scientifically, this Ajna Chakra area is often cited as the seat of thinking, concentration and memory. It is also the area which gets heated during stress and tension. Applying the tilak (generally using Chandanam) has a cooling effect and aids concentration.
In modern time, red tilak (Kumkum) is widely used by women. Considered a symbol of Goddess Parvati, it signifies female energy and is believed to protect women and their husbands. There is an interesting incident in the Ramayana regarding the significance of Kumkum. One day as Sri Jankidevi, wife of Lord Rama, was adorning her forehead with Sindur, Hanuman asked her, “Mata, why do you put this red thing on your head?” Sri Jankidevi replied, “By applying this, my swami (husband) will live long.” Since Hanuman is a Parama-bhakta of Sri Rama, he thought that if a pinch of Sindur could make his master’s life long, a whole lot of it would make him live much longer. So he rubbed it all over his gigantic body!
Well, even if the origin of the practice is unclear, the above incident in Ramayana makes it clear that the practice existed even during (or may be, well before) the Treta-yuga, in which Sri Rama lived.