Governments and charities have invested billions in vaccines developed by private firms.