The design and construction of cameras is full of tradeoffs. Many of them fall along a single axis with "small, cheap, bad image quality" at one extreme and "big, expensive, great quality" at the other. A given camera/lens unit can be anywhere on this axis.
The compact-vs-DSLR dichtomy is just a crude divison of this continuum into two distinct categories, but they do overlap and there isn't really any specific feature or advantage that one category absolutely cannot have (except the mirror viewfinder, by definition).
A short explanation of some of the tradeffs might help understand:
- Bigger sensors are more expensive to make but give better images, especially in low light conditions (due to some basic physics).
- The bigger the sensor, the more focal length for the lens is required to get the same angle of view (aka magnification), and focal length translates pretty directly to physical length (due to optics).
- The bigger the focal length, the wider the lens has to be to get the same amount of light (due to optics).
- Longer and wider lenses are more expensive to make, and (of course) bigger and heavier.
- The mirror for the viewfinder has to fit in somewhere, so you need a certain minimum focal length if you want it.
- The longer and wider a lens is the smaller the depth of field is (optics again), which you need for background blur but understanding and using it requires some knowledge (and time).
- So does manually adjusting ISO, aperture, exposure time etc. to get exactly the picture you want (rather than what the auto mode thinks is best). For convenience you want separate physical controls for those, but that again makes the camera bigger and more expensive.
So there you have it: take a small sensor, and you can use a smaller and cheaper lens to make a camera that doesn't cost much and you can take everywhere. Make it do everything automatically with a minimum of controls and your average customer is pretty happy once they've accepted that you just can't take good pictures in low light.
On the other hand, you can take a bigger sensor, the bigger lens it requires and make a camera that costs a lot more and takes much better pictures in some situations, and the people willing to buy it will happily pay extra for any useful feature you add, and it's big enough to fit in that mirror and the manual controls too.
And somewhere in between there is a range where you have cameras that aren't that big or expensive and already take pretty good pictures, and you can satisfy both the people who want "point-and-shoot, but with good quality" (by making a high-end compact that does everything automatically with a single flexible zoom lens) and those who really want to get into photography but don't want to lug around equipment that weighs 2kg and costs $2000 (by making a low-end DSLR or mirrorless system camera).
Oh, but you want to take super-detailed closeup pictures of wildlife 500 meters away at early dawn? Sure, we can do that, but it's gonna cost you six or seven figures and weigh 250kg...