Something I’ve encountered is being stuck on a difficult problem but then taking a break until an “aha moment” just materializes. This happened throughout college on difficult problem sets as well as countless engineering projects at work. Sometimes instead of getting hung up on a tough problem the best thing to do is to forget about it and go for a walk and let the subconscious take over. I don’t know why this works but it seems to be common with others as well.
Bill Gates takes an annual reading vacation where he reads books across a variety of disciplines in order to have their themes cross pollinate and spawn new thoughts and ideas. This isn’t a conscious process and he relies on his subconscious to do the organization and connect the different ideas together. This is akin to what happens when we stop thinking about a tough problem and focus on something else: the mind is free to wander and may combine them into something that’s useful - or at least inspire another thought that may be relevant.