how it is possible from a technical/coding point-of-view that a text-based markup language (HTML5) could be considered a replacement to a multimedia framework (Flash)?
HTML5 is the new hot name for "web technologies stack", not just a "markup language".
It has a programming language (JavaScript), like Flash does; a set of APIs, significantly expanding as part of the efforts commonly labeled as "HTML5", ways to draw graphics (SVG, <canvas>), play audio and video (<audio>, <video>).
Unlike Flash, the "HTML5 applications" are processed by the browser, not by a proprietary browser plugin, which is good - at least for browser vendors (see the relevant piece of this blog post - thanks Jotham). For example, it makes possible for a browser vendor to fix issues (and not wait for Adobe) -- IIRC Apple cited Flash as being #1 reason for crashes among all crashes on the Mac.
[edited to remove "open standards are better" claims which I am too lazy to back up]