Go Google the Grand Tack Theory....
Pretty much known Jupiter and saturn’s orbits were not always where they are today.
Jupiter's distance to Earth is just close enough for it to act as Earth's big brother and absorb comets and such into it's massive gravity well, preventing most of them from going to Earth and giving us frequent life extermination events (think asteroid wiping out the dinosaurs happening a lot). But if Jupiter was too close it's massive gravity well would cause too much tectonic activity on Earth. So it has to be just the right distance away.
This reminds us that Jupiter's distance from Earth is fairly temporary. Jupiter's goldilocks distance from Earth is occurring and just the right time frame for other things on Earth and with the sun that provide a narrow window of time for advanced life on Earth. (i.e. the sun's current involatile state). What a coincidence? No. What a Creator!