Judo is derived from Japanese Jiu-Jitsu. It whittled away the dangerous and useless techniques, turning it into an effective sport. Notice how I said both dangerous and useless techniques were whittled away, which is a very concise and complete summary about the benefit and con of sport vs. street art: The latter is not confined by rules, but the former involves more science/evolution.
BJJ founders claim to have taken it from Japanese Jiu-Jitsu, and after training a while you will probably realize that it is derived almost entirely from Judo newaza (ground techniques). For example, it focuses not on the standing locks/throws that JJJ is known for, but rather on ground techniques that Judo newaza is known for. A big influence on Gracie JJ was Kimura, who was a famous Judo guy.
Differences between BJJ and JJJ:
BJJ is more sporty, focusing more on safe but effective ground techniques that work against big guys. BJJ is good if you want to see results quickly and become a confident fighter on the ground, able to defeat clueless strong guys 1.5 times your weight with ease. It is invaluable in a confrontation against one large unarmed attacker, but requires more time to neutralize your opponent. Because combat is slower due toreduced entropy when both fighters are grounded, and many positions are very stable (requiring methodical steps rather than athletic speed to escape/change), it is widely agreed to be the most chess-like martial art at high levels, and can give much intellectual fulfillment.
JJJ is more streety/traditional, focusing on locks and throws that might be dangerous to practice under full resistance. It is good if you want to learn cooler looking techniques that could potentially put down an attacker much more quickly and be more “street practical”, but may or may not actually work against strong guys in a real situation (due to the impracticality of sparring with dangerous techniques under full resistance).
But traditional Gracie JJ addresses possible street attacks such as punches, groin kicks and headbutt, and even has a list of takedowns that work well against big guys who are punching; also, modern JJJ I believe has some sort of competition sport. So, the generalizations are not absolute.
Either art can be complete and effective as long as the practitioner realizes the trade-off between street and sport styles, and tries to provide for himself the best of both worlds.