To understand how a DSLR camera works (and what makes them so popular) it's necessary to first understand how its predecessor, the SLR camera works.
You may have seen an SLR camera and never realized it. These are the film cameras that were popular in the mid- to late-1990s. They consist of a camera body to which interchangeable lenses can be added. These lenses can vary, depending on the type of image a photographer wants to capture. Unlike today’s digital cameras, photographers had to load a photographic roll of film into the body of the camera before taking pictures.
Once the film was loaded, the camera worked using a reflex design. Light traveled through the camera lens to a mirror that reflected the image the camera was focused on to a pentaprism, which directed the exact image to a view finder.