Coltrane was moving out of jazz into something else. And certainly Miles Davis was doing the same thing.
No one knows exactly where thought comes from, but it can be said that thought comes from the same place as whatever it is that beats our heart... it comes from being alive.