There are 4 main ebook formats:

DjVu

PDF

FB2, EPUB

DjVu file is a scan.

PDF file is a scan or a layout.

FB2 file is XML file (text file with formating) with description and images in Base64 format.

EPUB files are zipped HTML files with description, styles, images and fonts.

So, DjVu and PDF are formats for scans. FB2 and EPUB are text formats.

These formats emerge from book digitization. If you process and encode scans, you get DjVu or PDF. If you recongize the text on the scans, you get FB2.