This whole thing goes back to 1305, when Pope Clement V was first elected to the papacy. Up until this point, popes had held their courts in Rome since time immemorial, but Clement was a Frenchman and he liked it in France, so he pulled a Melania and set up his court in Avignon. He also started packing the college of cardinals, whose job it was to elect popes, with other Frenchmen, which led to a succession of French popes in Avignon who were—according to many, at least—unduly influenced by the French monarchy.