Stress has mental, emotional and physical components. Insomnia is mostly a result of mental tension.
As stress becomes prolonged, the ability to focus becomes a limitation instead. The mind is unable to let go. The conscious mind doesn't see a clear solution for a problematic situation, and basically dumps it on the subconscious, which tries to solve it through brute force.
Constant stress lowers the level of consciousness and affixes it there. If we can raise the level of consciousness, we can look from other perspectives, solve the problem and hopefully release the stress. Insomnia occurs when we don't let it go lower either, in which case we disrupt a natural cycle, rob the body of natural rest and try to force inadequate solutions on the subconscious.
To heal stress related insomnia, there is only one choice: to completely let go of the stressful situation and accept the consequences. By doing so we allow the subconscious to do its recuperative magic, and provide the conscious mind with much needed deep rest.