In 1918 the Irish people of the "South" of Ireland(mainly Catholics that were south of Ulster) set up the Dáil Éireann and declared it the Government of the Republic of Ireland. The Dáil ordered the people of Ireland to pay taxes to it and it set up its own police force. David Lloyd George, the British Prime minister, declared it illegal and ordered the arrest of the Dáil members.
The creation of the Dáil initiated the conflict between 1918 and 1922. This was called the Anglo-Irish war, the sides: IRA (militant wing of republican movement) and Sinn Féin (political wing of republican movement) vs. The Royal Irish Constabulary and The Black and Tans (B&T's) and The Auxiliaries (Auxies).
The IRA's campaign was classic Guerilla Warfare, they executed hit and run attacks on police stations and individual RIC. The Black and Tans along with the Auxiliaries' campaign was to fight fire with fire, for every attack the IRA executed, the B&T's and the Auxies carried out random shootings, executions and torching of buildings. The war continued and there were atrocities that followed.
British now introduce the Government of Ireland Act (about 8 years too late), this gave Ireland "Home Rule" and 6 of the 9 counties of Ulster would be cut off from the rest of Ireland, this cut off group would be called Northern Ireland. Of course the Dáil, Sinn Féin and the IRA rejected this. The Protestants in Northern Ireland reluctantly accepted Home Rule; at least it would be a split from the Catholics in Sinn Féin.
The British forces heavily outnumbered the IRA. They were far better equipped, but their intelligence network was poor. But by mid 1921 the Sinn Féin military leader, Michael Collins, knew that the IRA was beaten, the last nail in the coffin was to be hammered in by De Valera and his associates. Collins was accused of being a coward and a murderer for using guerilla warfare. He was forced to "fight like a man" and execute a front-on attack on the Customs House (the IRA lost almost 80 men).
The Treaty now came into being. Basically this kept the border up, Northern Ireland was still separate, and the rest was called the Irish Free State. The Irish Free State was to be a Dominion (just like New Zealand). Lloyd George requested that members of the Dáil come to London to accept The Treaty. Being the political leader of Ireland, De Valera should have gone to London to accept The Treaty, but De Valera knew that The Treaty didn't offer a republic to Ireland so he sent Collins (the military leader of Sinn Féin) to London to bring back the bad news of a Dominion.
Collins (along with 4 others) returned to Ireland with the treaty signed and accepted. De Valera acted furious, but he knew, just as well as Collins did, that a Dominion was all Ireland would ever get by means of Blood Sacrifice or the like.
The Anglo-Irish War raged in full force from 1918 all the way through to late 1921, many lives were lost, but for Ireland the sacrifice of all those lives would eventually pay off.