CocoonJS is middleware, as you said, and acts as a wrapper. It takes your exported project's code and turns it into an .apk (I believe) that will be executed on android devices natively (no need to add anything more).
To execute on iOS phone, for now you can use appMobi and its DirectCanvas
, and in a (hopefully soon) future, cocoonJS will also be able to export to iOS.
Vidi's link is also an interesting read and links to ways to use the current wrappers available.
HTML5 is executed directly into a browser, on recent desktop computer, all goes fine, for mobiles, the current hardware and browsers are a little weak and that's why exporting/wrapping to "native" format appears as the way to go.
All this technology is still in development and evolving with each release of browsers and middleware.