Hey there, I've got a question... which is kinda hard to answer, but here it goes! When I started playing guitar, and I'd try to make stuff up, I'd always anticipate whats coming. Recently, while 'writing' stuff... I just let it flow, and kinda go where ever I feel like... and somehow it always turns out great! I used to be playing, and I'd be thinking "What's next? Where do I go from this note?" But now, I just kind of go... and somehow it works!

My question is,

Is everything needed to make music 'pre-programmed' in the human brain? Is there a general, instinctual understanding of intervals, beat, etc? Because, I used to suck at improvising... and I was trying so hard... yet now I just kinda let it go, and it always works out? Anyone care to explain?
You're probably just improving lol. Your ear is probably better, you're probably more familiar with what you're playing, more knowledged, phrasing has developed, so you're just more prepared to follow whatever is going on. That's usually how it goes.. the trick is to keep it going.
Naturually and obviously, you will become more experienced with the instrument and the more used to it you become the easier it will be to produce something that will sound much better, regardless if you know you're theory or not. I don't really apply the theory I know when I'm playing or writing stuff, rather, I let my curiosity take control and at times I'm successful. Also, if you are open-minded when it comes to music, you will open new doors to your own musical style. If you practice other artists' work, then you can, without knowing, use their material in combination with your own approach improving your overall sound. Hope this helps!
People tend to have the pentatonic scale memorized in their brains because it is the most common scale. Also the major and minor tend to be in peoples brain (or at least those with better aural skills) so if you are just working arround pentatonic and the major and minor scale you are probably going to what sounds "natural" becuase a big part of the music you listen to day to day use the major and minor scale or the pentatonic. After years of uncnscious listening this scales you´ve managed to learn them.
Fender Telecaster Thin Line

(For playing fusion as a solo project)
Ernie Ball VP Jr
Vox Wah
Korg DT-10 Tuner
Ibanez TS9 Tube Screamer
Mxr Phase 90
Electro Harmonix Small Clone
Boss DD6 Digital Delay