I see that BioNTech was founded in 2008. Moderna was founded in 2010.
I guess that like many advances, mRNA was (and still is) a new, promising technology that prompted people to found companies to bring it to the market. Moderna, as an American company, probably simply went to see DARPA when they were looking for funding because of the potential of the technology.