An EPUB is a zip containing XHTML documents, one or more per chapter, plus a manifest and a spine that says what order to read them in. That makes it the closest thing on this site to a source format: the input is already semantic markup, not a description of how ink lands on paper. Converting it is largely a matter of mapping one structured vocabulary onto another — h1 becomes #, ul becomes a bullet list, a paragraph stays a paragraph.
Because of that, EPUB gives the most faithful Markdown of any format here. A book comes out as continuous prose with its heading hierarchy intact and its internal links still pointing at the right sections, and chapter boundaries follow the spine order the publisher declared rather than a guess.
What does not survive is everything the reading system owns: the CSS a publisher shipped for typography, the cover art, and the package metadata beyond the title. DRM-locked books cannot be opened at all — the content documents inside them are encrypted, so there is nothing to read.