Think of it this way, the lens is the eye while the body is the brain.
The camera body, in not a insignificant way, does have an influence on image quality. The higher the resolution, the more details can be seen providing that you're using a lens that can produce those details. Not all lenses have the resolving power for a 40MP camera.
Another way the body impacts image quality is noise. The larger the sensor, the larger the pixels can be. The larger the pixel, the lower the amount of noise there will be for any given ISO setting. This is why the 12MP Sony A7S has such lower noise the the 50MP Canon 5DS R.
But besides image quality, the main difference between an entry-level camera like a T6 and a higher-end model (some would call the 5D IV a "pro" body), is that the 5D IV is more sophisticated and is higher performance. This means that the 5D IV gives the user more control over more aspects of the image-making process. It allows the user to track movement to consistently get shots of fast action in focus. Basically you can consistently get shots the way you want, when you want in a larger variety of shooting situations.
A good example is sports. A T6 has the ability to shoot at 3fps, while the 5D VI is capable of shooting at 7fps. The 5D VI has a much larger internal buffer that stores the shots as they're being written to the memory card. When the buffer is full, the frame rate drops to 1fps. Fortunately the buffer in the 5D VI is large enough (19 frames before slowdown when shooting RAW) that it's not likely to happen all that much, and if it does, one can switch to JPEG mode where the buffer can hold 174 images.
The 5D series of camera bodies have all been very well constructed being weather and dust proof and having a shutter with a much longer life expectancy.
There are a bunch of smaller things such as being able to remove and switch out the focusing screen for when shooting things like macro. Faster and more precise focusing.
So while a great lens on a cheap body will produce a superior image than a cheap lens on a pro body, that doesn't mean that you'll be able to consistently *(or at all) capture shots in challenging shooting situations. At that point you have to ask yourself which is worse, a super sharp image with the subject out of focus or a not so sharp image with the subject in focus because the camera was able to keep up with the motion of the subject. Which is better shooting a 3fps or 7fps and having a higher percentage of capturing just the right moment of the eagle as it wraps its talons around a salmon? One pays a lot for the ability to NOT have the camera be in their way of getting the shot.