Question: What factors contributed to related Jewish migration and life-choices in Poland, and ultimately this ranking of Poland back then? These factors could be geographic, legislative (Statute of Kalisz, Warsaw Confederation?) or other.
The history of jewish people in Poland goes back a millennium. There is debate about why Jews began settling in Poland. Reasons being put forward have to do with security, geography, and religious tolerance.
Security & Georgraphy
Some date the beginning of the Jewish migration to Poland to 1024 and Pope Urban II's call for crusade to liberate the holy lands from the Moslems. The resulting armies flowing from Europe into the holy lands victimized Jews, Moslems, and Orthodox Christians alike on the way to Crusade. For the Crusaders going to the holy lands to fight heretics, many would not differentiate killing non Christians closer to home. One argument was Jews fled to Poland because it was on the frontier of the Christian/Catholic world and thus not on the path the crusaders traveled.
Jews of Poland.
One of the theories is that the “butterfly effect” that led the Jews of Ashkenaz to migrate to Poland began with a speech by Pope Urban II, who in 1096 called for the liberation of the holy sites in Jerusalem from the Muslim rule. The Pope's call ignited what would come to be known as The Crusades - vast campaigns of conquest by the Christian faithful, noble and peasant alike, who moved like a tsunami from Western Europe to the Middle East, trampling, stealing and robbing anything they could find along the way.
Out of a fervent belief that “heretics” were “heretics”, be they Jews or Muslims, the militant pilgrims made sure not to bypass the large Jewish communities in the Ashkenaz countries, where they murdered many of the local Jews, mostly in the communities of Worms and Mainz on the banks of the Rhine. Following these massacres, known in Jewish historiography as the Massacres of Ttn”u (after the acronym of the year of Hebrew calendar), Jews started migrating east, into the Kingdom of Poland.
Also the Kingdom of Poland and latter the Polish-Lithiwanian
Poland was invaded by the Mongols in the thirteenth century, and Poland actively tried to attract immigrants in that period to make up for the loss of population.
Jewish Virtual Library
While persecution took place across Europe during the Crusades, in the 13th century, Poland served as a haven for European Jewry because of its relative tolerance. During this period, Poland began its colonization process. It suffered great losses from Mongol invasions in 1241 and therefore encouraged Jewish immigrants to settle the towns and villages. Immigrants flocked to Poland from Bohemia-Moravia, Germany, Italy, Spain and colonies in the Crimea. No central authority could stop the immigration.
Freedom of Worship and Assemble was also granted eventually to the Jews in the 13th century.
Jewish Virtual Library
In 1264, Duke Boleslaw issued the "Statute of Kalisz," guaranteeing protection of the Jews and granting generous legal and professional rights, including the ability to become moneylenders and businessman. King Kasimierz ratified the charter and extended it to include specific points of protection from Christians, including guaranteed prosecution against those who "commit a depredation in a Jewish cemetery".
During the 14th and 15th century, Jews were active in all areas of trade, including cloth, horses, and cattle. By the end of the 15th century, Polish Jews began trading with Venice, Feodosiya and other Genoese colonies in the Crimea, as well as with Constantinople.
By the mid-16th century, eighty percent of the world’s Jews lived in Poland. Jewish religious life thrived in many Polish communities.
Things began to change in the 17th century as Poland would weaken and become partitioned by other greater powers.
Wikipedia:History of Jews in Poland.
Poland's traditional tolerance began to wane from the 17th century onward. After the Partitions of Poland in 1795 and the destruction of Poland as a sovereign state, Polish Jews were subject to the laws of the partitioning powers, the increasingly antisemitic Russian Empire, as well as Austria-Hungary and Kingdom of Prussia (later a part of the German Empire). Still, as Poland regained independence in the aftermath of World War I, it was the center of the European Jewish world with one of the world's largest Jewish communities of over 3 million.