In a large number of people insomnia i a chemical disorder of the brain.
For me i have a 30 hour internal clock. not a 24 hour.
Before i found a treatment for my fibromyalgia restless leg syndrome and apnea it was a 72 hour internal clock.
For people with painful disorders the brain changes and your normal chemical balance is no longer there.
And even though you later get the pain under controll the chemical imbalance stays there.
The brain chemical that promote sleep are overridden by pain chemicals.
Sleep apnea my also override these sleep chemicals.
Plus over the counter herbal remedies are basically worthless except as placebos.
There are a number of them chamomile, valerian root, kava kava, lemon balm, passionflower, lavender, and St. John’s Wort. Melatonin
Many could not get to the brain because they are larger the allowed by the blood brain barrier.
One strange thing is some people find is that Provigil a narcolepsy med works for Insomnia if taken first thing in the morning.
Most doctors treat with serotonin enhancing drugs like anti depressants.
While these may work for a few(that likely have depression) they ether have little effect beyond placebo in many others.
My doctors tried them on me and they made things worse.
plus i ended up with serotonin syndrome on top of everything else.
luckly i only had a head to toe itching as a symptom of serotonin syndrome