As he and his wife were hiding out in the little village of Loudres while trying to escape to freedom in the USA during WWII, Werfel felt the Nazi noose tightening around them and realizing that they might well be caught and executed, he made a promise to God to write about the "song of Bernadette" that he had been deeply inspired by during their clandestine stay Lourdes.
An amazing aspect of this powerful portrayal of a Catholic saint and an essentially Catholic story is that Werfel was a rather secular Jew, and yet he was so deeply impressed by both Bernadette and the happenings at Lourdes, that his writing has a profound sense of Catholicism's sacramental imagination about the world.