why was the border between northern ireland and the irish free state (which became the republic of ireland in 1948) placed where it was placed?

The border between Northern Ireland and the Irish Free State was placed where it was due to the 1921 Anglo-Irish Treaty. The treaty established the Irish Free State as a self-governing dominion within the British Empire, and the border was drawn to separate the two entities. The border was also designed to reflect the political and religious divisions between the two countries, with the majority of the Protestant population living in Northern Ireland and the majority of the Catholic population living in the Irish Free State.