A raw file holds sensor counts, not a picture
Each photosite under a red, green or blue filter recorded one number. Turning those numbers into an image takes several steps: subtract the black level, scale to the white level, white balance, demosaic (rebuild the missing two colours at every pixel), convert camera colour through a matrix and apply exposure and tone. DNG writes down every input those steps need as TIFF tags. Most other raw formats keep some of them in private maker notes. This page reads DNGs itself, decodes their lossless JPEG tiles and develops them step by step. From other raw formats it identifies the format and pulls out the embedded JPEG previews.
Building the sample…
This is a LinearRaw file: the camera or phone demosaiced it before writing, so there is nothing to compare. Load a Bayer sample.
A DNG is a TIFF whose first directory usually holds a small preview and points through SubIFDs to the full-size raw image. Click a directory to list its tags. Tags the darkroom above actually used are tinted. Embedded JPEGs are found both through the tags and by scanning the bytes for JPEG markers, which also works for CR3, RAF and other non-TIFF formats.