Self-containment is entirely unrelated to a format. You could do self-contained markdown, HTML or anything else if you wanted to.
Annoyingly, EPUB isn't inherently self-contained [1], but external access is explicitly optional [2], and it does make self-containment easier, because you can reuse resources across multiple pages, whereas HTML requires you to either duplicate the resources across multiple pages, or you have to build your thing as a single massive HTML page.
[1]: https://www.w3.org/TR/epub/#sec-resource-locations
[2]: https://www.w3.org/TR/epub-rs/#sec-epub-rs-network-access
You can mandate them to be if you are building something that uses them. If you don't have control, than its up to someone else to decide, and people wanted to be able to link remote resources.