Usually these are referred to as blank product templates. How it works depends on the template format type.
IE: If you have Photoshop template, it may be a series of layers for the case, then your printable image just slides around so that it overlays overtop of the display area. The image will stay separate from the layers, so you will still have a full image, but display-wise it will be cropped and masked to fit the case as if it was a finished product.
If it's a vector template, you can create a clipping mask (Illustrator) or powerclip it (Corel).
IE: If you have Photoshop template, it may be a series of layers for the case, then your printable image just slides around so that it overlays overtop of the display area. The image will stay separate from the layers, so you will still have a full image, but display-wise it will be cropped and masked to fit the case as if it was a finished product.
If it's a vector template, you can create a clipping mask (Illustrator) or powerclip it (Corel).