This is a classic interchangeable lens camera design where you see an optical image in the viewfinder that shows the view through the lens. They do this using a mirror inside the body that reflects the image seen by the lens up on to a focusing screen, which is then viewed via a pentaprism or pentamirror into the viewfinder eyepiece.
When you take a picture, the mirror flips up out of the way so that the image passes through the body to the sensor at the back of the camera. DSLRs work in the same way as SLR (single lens reflex) film cameras, but substitute a digital sensor for the film. Mirrorless cameras get their name from the fact there is no mirror and to distinguish them clearly from DSLRs.