The rest of the planets are theorized to have condensed from the protoplanetary disk that formed the same molecular cloud the Sun did. I. e. they have formed at approximately same time as the sun and from same material, sans gravitational separation.