What I can say in my case is that many of the problems I worked on took my team days if not weeks to finally solve...
I think that long, deep, focus on a problem is probably key. Dreams are the brain's opportunity to do some housework and clutter removal and if almost everything is about a group of tricky issues then the brain perhaps clears out the dross, leaving some clarity.
Just a though ... it may be totally wrong, it's definitely not my field.
Sadly I have little idea how one might capture that for songwriting
