This kind of insomnia is due to the body - kidneys and liver, mainly - cleansing. :) the major organs work extra hard at this time (3-4 am usually) and it interrupts other functions such as sleep, especially if you have other co-factors such as what you ate for dinner, how much water you didn't drink, low salt, candida, etc.
Chronic insomnia is a warning sign of a congested liver, as the liver is where the metabolism of tryptophan etc. into melatonin/seratonin takes place. :)