I am looking into a Nikon camera that says 20x in the lens
It's probably not a DSLR...
and another Canon which I need to purchase the lens separate
That's a DSLR.
My confusion again is which one is better?
The answer to this question is very complicated... DSLR cameras deliver better image quality. That's because their sensor is larger and collects more light, and their lenses are generally higher quality. They are advanced tools that can make wonders in the hands of someone who knows how to use them. They are better in low light.
However, compact cameras are more... compact. They're more convenient to carry, easier to use, much cheaper, can be used to make movies, they can be slipped in a pocket, etc.
Why there is no DSLR with lens larger than 20x?
Because when you purchase a DSLR, shelling the high price they go for, you want good quality lenses to go with it. And a 20X lens will never be "high quality".
Designing a lens, especially a zoom lens, is a compromise. The lens cannot do everything well, as you can easily guess. So if it can produce good images at its widest focal length, it probably won't produce very good images at its longest focal length.
There are many design limitations that cannot be made optimal at all focal lengths, so designer make the lens best at a given focal length, accepting that image quality will degrade as you move away from that focal length. The more you move away, the worse the image quality becomes.
That's why some professional DSLR lenses are not zoom lenses, they are "primes" : lenses with one, fixed focal length, where everything is optimized.
Lens design can be very complex, but I hope I was clear enough to give you some understanding.
The beauty of owning a DSLR is that you can get a few, high-quality lenses to suit your needs. And you can swap your lenses on the camera body as you go.
Feel free to ask questions if you need to