Countries don't just split for any one reason. The social and political issues and background to the partition of Ireland complex and numerous so sadly this answer won't go into near as much detail as one would like however that being said I feel I can provide a basic outline of the partition. I would really recommend The Making of Modern Ireland 1603-1923 by JC Beckett and The Narrow Ground: Aspects of Ulster 1609-1969 by ATQ Stewart if you want some further reading.
Ireland has historically been divided into four provinces: Connacht, Leinster, Munster and Ulster. The majority of Ireland has been historically Roman Catholic but in the early 1600s an event known as the "Plantation of Ulster" took place which was the planned colonization of Ireland by mainly Protestant settlers from Lowland Scotland and England.
Skip forward a few yeas to The Acts of Union 1800. This united the Kingdom of Great Britain and the Kingdom of Ireland to create the United Kingdom of Great Britain and Ireland. Great Britain being the island consisting of England, Scotland and Wales and Ireland, well, the island of Ireland. This agreement was largely seen to benefit the ruling class of Ireland and be detrimental to the average Irish citizen. In 1858 The Irish Republican Brotherhood (IRB) was formed. This was a secret oath-bound fraternal organisation dedicated to the establishment of an "independent democratic republic."
As time went on it became apparent to many Irish people that the British government did not have the best of intentions for the Irish people (most notably the British government's inaction during the famine in the 1840's) and in the 1870's gave rise to the Irish Home Rule movement. It started when Irish barrister Isaac Butt founded the Home Government Association in 1870. This eventually became the Home Rule League in 1873 before transforming once again into the Irish Parliamentary Party in 1882. They fielded candidates for the House of Commons in British elections and hoped to accomplish their aims there. It should be noted that these groups did not want an Irish Republic but rather wanted home rule within British House of Commons (i.e as part of the United Kingdom of Great Britain and Ireland)
They field 3 Home Rule bills that aimed to grant Ireland Home Rule. The First Home Rule Bill was put forth in 1886, but was defeated in the House of Commons, Liberal British Prime Minister William Ewart Gladstone put forth the Second Home Rule Bill in 1893; it passed the Commons but was defeated in the House of Lords. After the removal of the Lords' veto in 1911, the Third Home Rule Bill was finally introduced in 1912. This was the start of the Home Rule Crisis.
Many of the Ulster Protestants felt that a government ruled from Dublin would neglect Ulster. Not only because Ireland was majority Protestant but also because Ulster was heavily reliant on shipbuilding, linen and other industrial activities while the rest of the island was focused on agriculture.
Half a million people signed the Ulster Covenant on or before September 28th 1912 which protested the Home Rule Bill. Many of the signatories formed a paramilitary, The Ulster Volunteers, opposed the Act and the authority of any Dublin Parliament, by militant force if necessary. Irish Nationalists responded by setting up the Irish Volunteers "to secure the rights and liberties common to all the people of Ireland". The Irish Volunteers was secretly under the control of the IRB (most notably one of the Volunteers top members were IRB members Seán Mac Diarmada and Piaras Béaslaí) Both sides began to import arms and weapons from Germany.
The 1916 rising (worth of an /r/askhistorians thread of it's own) happened on Easter Monday 1916. This was an attempt by the IRB, using mainly Irish Volunteers as a proxy (but also a few smaller paramilitaries) to stage a violent revolution to overthrow the British government and proclaim an Irish Republic. After 6 days It failed and the leaders were executed however the leaders became martyrs and support for Irish independence grew. This gave rise to the political party Sinn Féin who won many seats in British General Elections. As a protest they refused to take their seats in Parliament (a policy known as Absenteeism.)
In the December 1918 election, Sinn Féin won a landslide victory in Ireland and formed a breakaway government known as Dáil Éireann which declared independence from Britain. The meeting of the First Dáil took place on 21st of January 1919. The same day two members of the armed police force, the Royal Irish Constabulary (RIC), were shot dead in County Tipperary by Irish Volunteer members who acted on their own. This kick started the Irish War of Independence against Britain. Afterwards the Irish Volunteers were renamed to the Irish Republican Army (IRA)
Military IRA leader Michael Collins pioneered many modern guerrilla warfare techniques. The IRA began to attack British government property, carry out raids for arms and funds and target and kill prominent members of the British administration. The IRA's main target throughout the conflict was the Royal Irish Constabulary (RIC), the British government's police force in Ireland. In early April 1920, 400 abandoned RIC barracks were burned to the ground to prevent them being used again, along with almost one hundred income tax offices. In 1920 the British government became more brutal in their treatment of Ireland imposing increased the use of force, paramilitary police units and even went as far on 9 August 1920, the British Parliament passed the Restoration of Order in Ireland Act. It replaced the trial by jury by courts-martial in areas were IRA membership was prevalent. On 10 December 1920, martial law was proclaimed in Counties Cork, Kerry, Limerick and Tipperary. The peak of violence during the war was in 1921. 1,000 people including the RIC police, army, IRA volunteers and civilians, being killed in the months between January and July 1921. Eventually the The War of Independence ended with a truce on 11 July 1921.
The treaty proposed by the British government only 26 counties of Ireland be granted Independence while 6 of the 9 counties of Ulster remain part of the United Kingdom. There was split among the IRA into pro-treaty and anti-treaty forces and the Irish Civil War broke out. It ended in the assassination of anti-treaty leader Michael Collins. The treaty was signed a Ireland was partitioned into Northern Ireland and the Irish Free State (later Republic of Ireland)