True bam file encoding and viewing as text
Why not work only with sam files and we need to convert them to bam?


SAM is for human only, a binary format like BAM is smaller and parsed much faster by a program (and we want speed and optimize spaces for those huge files, don't we ?).

Furthermore, bam files are compressed using a  method that allow them to be accessed using random-access, that is how you can query a sub-part of bam file for a given genomic location.

you can always go back to SAM using samtools.