In at least some religions, [part of] the definition of God is that he is the uncaused cause. Thomas Aquinas spends a lot of ink talking about this (there's a more accessible explanation at http://www.peterkreeft.com/topics/first-cause.htm, but I'm pretty sure you can find the originals on the Internet).
Just because God can't imagine an existence outside herself doesn't mean it doesn't exist. She assumes she is the original cause but is unable to test the hypothesis.