Disseminating printed documents in many places on the planet is a very robust "backup" strategy for scientific literature. Printed documents (and other forms of ink-on-paper documents), or fragments of them, are known to last for millennia and with a high redundancy (many copies spread in many geographic locations), the chances of being able to reconstruct the original content is high.
All current electronic data storage require continuous catering (electrical power and servers maintenance) or frequent re-copying (i.e. of laser discs, magnetic hard drives, etc.) to last more than a few decades.
How do online-only journals and articles repositories intend to ensure very long-term archival of their content?
Open access journals and article repositories have a good option of ensuring very-long term access that is similar to how printed documents were handled in the past: Wide dissemination over several repositories.
In the life sciences, open access articles are often deposited in additional repositories by publishers themselves, for example at Pubmed Central or it's European equivalent Europe PMC. I think also additional repositories actively mirror some open access journals - at least I frequently seem to get results of such additional repositories through internet searches. That means even if the publisher goes bankrupt and shuts down its servers, the papers should still be easily accessible through these mirror repositories. See for example Biomed Central's statement on permanency of articles.
This strategy is only possible for open access journals, since only those typically allow redistribution of their articles and thus permit the mirror repositories to act as they do. I have no idea how commercial, non-open access publishers handle this problem.