My current take on this is that the first intelligent agency that figured out how to become immortal eventually evolved into God. This probably happened before the concept of matter evolved, and an unimaginably long time ago, perhaps before even time itself existed.