There are often misconceptions about how government works in the United Kingdom, so it's worth setting matters straight here.
Ultimately Parliament derives from the Witangemot, the meeting of 'wise and great men of the kingdom' that would elect the new king of Wessex from members of its royal family, and then advise him. The Witan was based in the West Saxon capital of Winchester, hence the name (originally Wintanceastre). When Wessex became the dominant part of a united England, this tradition continued.
The Norman Conquest, however, instituted a new Continental notion of an absolute monarchy inherited by direct primogeniture. The Witan died with the Anglo-Saxon nobility. The idea, however, did not. In the 13th century, Norman monarchs starting with Henry III began calling new Parliaments (from French parlement, a place for talking) consisting of their nobles and senior churchmen. A significant milestone was when Simon de Montfort called the first elected parliament in the 1260s (with a franchise that was actually wider than it would be again for many years to come) during his rebellion against the King. Montfort is now honoured as one of the fathers of democracy by both Britain and the United States.
As Parliament grew in power, the fifteenth century saw the franchise in rural seats being restricted to those who owned property equivalent to forty shillings. This number remained unchanged with inflation in England (though not in Scotland) however, so the percentage of the population that could vote slowly increased over time. The urban or 'borough' seats had a variety of different franchises, some just having their local council choose the MP, others letting all freemen vote or everyone who owned a certain amount of property or paid a certain tax vote.
The seventeenth century saw King Charles I, who had absolutist ideas, trying to rule without Parliament - even though he needed Parliament's authority to raise taxes to fund his wars. This resulted in the English Civil War, which was itself only a part of the Wars of the Three Kingdoms in England, Scotland and Ireland. Parliament fought the King and won, with Charles being executed and Parliamentary leader Oliver Cromwell ruling the new republican regime as Lord Protector. However, he too soon dissolved Parliament, finding it unworkable and leading to the Parliamentarians looking hypocritical.
After Cromwell's death, Charles' heir came back as Charles II and the Stuarts ruled for about thirty years. However, when the Catholic James II came to the throne and was rumoured to have produced an heir, the Glorious Revolution occurred. William of Orange, the Dutch Stadtholder married to James' daughter Mary, came over with an army and kicked the Stuarts out of the country. The Parliament of England recognised William and Mary as joint monarchs, hence why this is known as the Glorious Revolution and not the Dutch Invasion With Excellent PR. This marked the time when the monarch's role became decidedly secondary to Parliament.
Between the Glorious Revolution (1680s) and the Great Reform Act (1830s) Britain was governed by ministers theoretically chosen by the King from Parliament, but in practice this only worked if those ministers already enjoyed support among their fellows. Party lines meant little in this era - MPs were usually elected on the basis of their individual personality or the family they came from, and then chose to join a faction after they had been elected. Each county elected two MPs (the origin of U.S. states electing two senators each) and then large towns and cities, 'boroughs', also elected either one or two MPs. However, new boroughs had not been introduced for a long time, leaving large new cities like Manchester without representation. Also, old boroughs for places that had been thriving cities in the Middle Ages but had now been largely abandoned were not cancelled, so hamlets of five people continued to elect two MPs. These were known as the Rotten Boroughs, and for much of the 18th and 19th centuries, parliamentary reform was aimed at abolishing them.
The power of the King was reduced over this period, partly because the new Hanoverian monarchs often did not speak English and were more interested in their European possessions. The 1720s saw the South Sea Bubble, a financial scandal which meant most of the King's ministers resigned. Their powers were amalgamated by the one senior minister who had escaped charges, Robert Walpole, and he became the first Prime Minister - a title which, until the 20th century, was a pejorative one. After the loss of the American War and the madness of King George, William Pitt the Younger became PM. Beginning as a liberal reformer, both he and Parliament in general became more and more conservative in reaction to Revolutionary France, the enemy in that period. This ended with the 1810s and 1820s, in which British popular reformers, the Chartists, had their demonstrations crushed by British troops in controversial actions such as the Peterloo Massacre.
This ended in the 1830s when the PM, Earl Grey (famous for tea) passed the Great Reform Act. This got rid of the rotten boroughs and changed the electoral system so that each constituency now only elected one MP. However, the fact that Oxford and Cambridge Universities both elected MPs from their own faculty was retained until after the Second World War. Universal male suffrage did not happen until after the First World War.
A general election is called. Various parties nominate candidates for a constituency and they stand. Whoever gets the most votes (“first past the post”) is elected MP. The House of Commons is made up of 600-odd elected MPs. Whichever party has the most MPs forms the Government, while the second largest becomes the Official Opposition. Usually a government must have a majority in order to govern effectively - coalition governments are rare in Britain. The Queen then (theoretically) picks the Prime Minister from among the largest party, but in practice Her Majesty always chooses whoever that party has already chosen to be their leader. The new Prime Minister chooses his Cabinet ministers from among his party's MPs and Lords, while the Leader of the Opposition picks Shadow Cabinet ministers, whose role is to criticise their counterparts.
One of the most entertaining parts of British politics is Prime Minister's Question Time, in which the Leader of the Official Opposition gets six questions to ask the PM, and the leader of the smaller opposition party gets two. These questions are usually something along the lines of “In light of recent events, does the Prime Minister agree that his government is hopelessly incompetent?” and then the PM has to cleverly twist this into an attack on the Leader of the Opposition's party's record when they were in power. When in Parliament, MPs are always referred to as “the honourable gentleman” or “my honourable friend”, unless they are on the Privy Council, in which case they are “my right honourable friend” or “the right honourable gentleman”. Lords are referred to as “the noble lord”.
The Privy Council is essentially the Cabinet ministers plus a few semi-ceremonial offices and the Leader of the Opposition. This was formerly the highest court of appeal in the British Empire: for example, when Canadian suffragettes had failed to get their government to agree to let them stand for public office, they appealed to the Privy Council of the United Kingdom, which overruled the Privy Council of the Dominion of Canada and let them stand. The Privy Council is also the arbiter of succession and holds sovereignty for the brief period in between a monarch dying and his heir succeeding him - this becomes official when the Privy Council, as part of the Accession Council, issues a Proclamation of Accession.
The House of Lords has lost many of its powers over the years but is essentially an unelected body intended to peruse and criticise Commons legislation from a less partisan viewpoint. The Labour Party recently abolished many of the former hereditary peers and replaced them with appointed 'life peers' who, purely coincidentally I assure you, were mostly old mates of Tony Blair. The Lords generally cannot shoot down Commons legislation these days but it can keep endlessly sending it back for revision. The exception is the Parliament Act, which the government can use once every session to force a piece of legislation through: Labour has recently been using this much more often than was formerly the convention. Although the monarch's powers are these days mostly theoretical, bills do not become law until they receive Royal Assent. It is also the Queen's role to dissolve parliament and call a general election, although in practice this almost always happens because the PM has asked Her Majesty to do so.
Recently (2009) a great many scandals to do with the MPs' expenses system and them claiming for second homes have broken, with the result that the next election may result in a serious political upheaval greater even than the already predicted massive loss to Labour. The aftershocks of this have already included the Speaker being forced to resign for the first time since the 1690s.
If no party has a majority in Parliament, it is known as a 'hung Parliament'. The most usual solution is for the largest party to create a minority government and govern via pacts with smaller parties, then call another election when they think they can increase their majority. Coalition governments are very rare in British history and usually only come about in time of war or other national crisis. However, recently this status quo was challenged when the 2010 general election produced a hung parliament and the end result was a coalition government between the Conservatives and the Liberal Democrats.
These happen when an MP dies or otherwise has to resign his or her seat (note that it is technically impossible for an MP to resign - they have to take up one of two sinecure offices and then resign from that). An election is called under the same system as the general election but for only the constituency in question. (These are called 'special elections' in the USA). By-elections are notable because the media often regard them as being a measure of public opinion for the government at the time, even though local issues may predominate. The party in power very rarely wins by-elections. Britain's third party, the Liberal Democrats, have a good track record of winning by-elections but then failing to translate this into wider success at a general election.
New Labour tried to move the UK towards federalism by introducing devolved parliaments in 1999. These consist of the Scottish Parliament, the Welsh Assembly and the Northern Ireland Assembly, as well as the London Assembly. All of these are elected on a hybrid proportional representation basis. Nationalist and minor parties typically do much better there than at Westminster. There have been some moves towards an English parliament as well; Labour originally wanted parliaments for each English arbitrary region, but this was soundly defeated in a referendum.
Local councils have existed in the form of 'borough corporations' for centuries, but were first made consistently elected rather than self-appointed due to part of the reforms of the 1830s. Since that time, governments have reformed and altered the systems of local government until Britain has ended up with an inconsistent mess. Nowadays, the country has a mix of different kinds of councils, some of which overlap the territory of others, which are elected on timetables unique to the type: some councils elect all of their members every four years, either one-member seats by FPTP or multi-member seats elected by bloc vote; others hold an election every year for one of the three seats in each multi-member seat, with the result that one-third of the council is up for election at any time (a bit like how the US Senate works). Scotland is unique, having councils elected by Single Transferable Vote (STV) due to the Liberal Democrats wanting this as the price for their coalition partnership with Labour in a past Scottish devolved government.
These days, the media slavishly follows all local elections and uses them to try and say something about Westminster, even though in theory you should be electing local councillors based on local issues rather than party. In practice, many people just use them to punish the incumbent party, like midterms in the US.
Labour Party: Was in power for 13 years, 1997-2010. Started out around the turn of the 20th century as the radical socialist party of the working man. After actually gaining power in the 1920s it drifted toward the centre-left. The 1945 postwar Labour government embarked on a programme of nationalisation, of which the National Health Service is the most important product. This 'socialist consensus' was allowed to stand by other governments until 1979, when Labour lost power to the new strongly rightist Conservatives. Labour turned to the hard left and became virtually unelectable for years - shedding its right wing as the Social Democratic Party - until first Neil Kinnock and John Smith, and then especially Tony Blair, brought it back towards the centre. Blair in fact got rid of almost all the economically socialist parts of the party, but kept the social aspects. Even though many Labour backbenchers were 'Old Labour' socialists, this system held together for years - only breaking down with the party's defeat in the 2010 election. Another election defeat in 2015 led to the surprise election of long serving backbencher Jeremy Corbyn as party leader. His often radical left wing views have not helped to unite the party, and there have been frequent resignations from the Shadow Cabinet during his time as leader. Their colour is red and their symbol is the rose.
Conservative Party: Currently in government. Began in the 1830s, but ultimately descends from the 17th-century Tory Party (its members are often still called Tories). Traditionally right-wing on both economic and social issues - the latter being known as either the “Flag, Faith and Family Group” or the “Taliban Tendency”, depending on who you talk to. In 1951 the Conservatives decided to accept the Labour-penned 'socialist consensus' and this persisted until Margaret Thatcher became Britain's first female PM in 1979. The Thatcher government privatised absolutely everything and enacted many economic reforms which either made everything much better or far worse, depending on who you ask. Thatcher continues to polarise opinion more strongly than any other politician in British history. After losing to Blair in 1997 and spending many years in the political wilderness, the Conservatives seemed tipped to be the next government under their leader David Cameron. In the event though, they only managed a plurality, and formed a coalition with the Liberal Democrats. They managed an outright, although slim, majority in 2015, although Cameron's defeat in the EU membership referendum led to his resignation and replacement by Theresa May. Also the party of colourful MP (now Foreign Secretary) and former Mayor of London, Boris Johnson. Their colour is blue and their symbol is the tree, formerly the flaming torch.
Liberal Democrats: Originate from the old Liberal Party, formerly a major 19th-century party but a victim of its own success when the voting system changed. The last nail in the coffin was when leader Jeremy Thorpe turned out to be in a gaysexual relationship with a male model in the pocket of a Soviet spy ring. The last remnant of the Liberals then joined with the SDP, a breakaway Labour faction (see above) in the 1980s to form the Liberal-SDP Alliance. This eventually became the Liberal Democrats, or Lib Dems. They were for some time Britain's third-largest party (until the rise of UKIP, the Greens and the SNP) and their ambitions for power are chiefly limited to being the decider for forming a coalition government in a hung parliament (where there is no overall majority). The Lib Dems' support base is chiefly students and people in very isolated parts of the UK, e.g. Cornwall. The one policy of theirs everyone can name is their commitment to change the electoral system to bring in proportional representation - which would, purely by coincidence I assure you, result in them winning many more seats. In the 2010 election, they finally entered government in coalition with the Conservatives, but lost much of their support as a result. The party crashed to a mere eight MPs in the 2015 General Election, rising to nine after a by-election win in 2016. Under their current leader, Tim Farron, they have been most notable for their stance on Brexit, calling for a second referendum on the final deal. Their colour is yellow or orange and their symbol is a stylised bird.
UK Independence Party: Concieved as a single-issue party, otherwise Conservative in attitudes, that wants Britain to withdraw from the European Union. Since the 2010 election UKIP was in the ascendant under controversial leader Nigel Farage, partly due to the Euro crisis but mainly because, as the Lib Dems were now in government, they were hoovering up the 'plague on both your houses' vote. UKIP won the 2014 election to the European Parliament, also winning two by-elections to Westminster, but lost one of the seats in the General Election the following year. The party finally achieved its goal in June 2016 with the victory for the Leave campaign in the EU membership referendum, but has since descended into infighting, recently losing its sole remaining MP. The incumbent leader is Paul Nuttall. The party colour is purple, and their logo is a purple pound symbol on a yellow background.
Green Party: Far less successful than the ones in Europe, but has managed to get several councillors and London Assembly members elected. Obviously environmentalist and generally socially liberal. They recently decided to choose a single leader, previously having several spokesmen, but have since reverted to a dual leadership, at the moment Caroline Lucas and Jonathan Bartley. Won their first seat, Brighton Pavilion, at the 2010 election.
Plaid Cymru: Welsh nationalist party, in theory wanting independence for Wales, but in practice probably not willing to go that far. Pronounced 'plyde cummry', and led by Leanne Wood.
Scottish National Party: Wants independence for Scotland and means it. After steady success, they were able to push through an independence referendum in 2014, but lost 55-45. Despite this defeat, the SNP enjoyed a strong bounce in the 2015 General Election, taking all but three of Scotland's seats. In the aftermath of Brexit, they are now pushing for a second vote on independence. The party leader is Nicola Sturgeon, who replaced Alex Salmond in 2014. The party is notably supported by Sean Connery.
Democratic Unionist Party: A strongly socially conservative unionist party based in Northern Ireland and also the largest party in the Province. With the retirement of the veteran loyalist Ian Paisley as leader, Peter Robinson took over in 2008, followed by Arlene Foster. The Renewable Heat Incentive (RHI) scandal hit the party badly, leaving it only one seat ahead of Sinn Fein at Stormont after a snap election in March 2017.
Ulster Unionist Party: More moderate than the DUP, the UUP was once the dominant party in Northern Ireland until the political crises which unfolded during the Troubles. It now lags well behind the DUP, and is currently led by Robin Swann after Mike Nesbitt's resignation due to a poor showing in the 2017 Assembly Election.
Traditional Unionist Voice: A right wing loyalist party, formed as a breakaway from the DUP by the outspoken Jim Allister. Mr Allister remains the party's only MLA.
Sinn Fein: Pronounced 'Shinn Fayn', it is a left wing republican party from Northern Ireland with ties to the IRA, although it has gradually become more moderate. It also stands candidates in the Republic of Ireland. Its MPs do not take up their seats when elected due to refusing to swear an oath of allegiance to the Queen. However, they do take up their seats when elected to the devolved Northern Ireland Assembly. Currently led in Northern Ireland by Michelle O'Neill, the overall party leader is Gerry Adams.
Alliance Party: Attempt at forming a religiously non-partisan group in Northern Ireland, initially not with much success, but Naomi Long won their first Westminster seat in 2010, unseating DUP leader Peter Robinson after a scandal. She is their current leader, although now as an MLA. Loosely affiliated with the Liberal Democrats.
People Before Profit: A relative newcomer to Northern Irish politics, PBP stands across the island of Ireland, although they do not define themselves as Irish nationalists.
Social Democratic and Labour Party: A Northern Ireland party which leans towards joining the Republic but is not rabid about it. Sits on the Labour benches at Westminster. Dwindling support has led to them being nicknamed the 'South Down and Londonderry Party' after the only areas outside West Belfast where they seem to be able to get elected anymore. The current leader is Colum Eastwood.
British National Party: The newest and most scrubbed-up variation of Britain's far-right fringe. The BNP is universally loathed and despised in the media and certain sectors of society, but this often simply has the effect of making it a forbidden fruit. Originally a cut-and-paste Nazi group, it was considerably reformed by its last leader Nick Griffin to suit modern attitudes - for example, rather than being anti-Semitic, it now supports Israel as an 'outpost of civilisation' against the Muslims, who are its main targets. Has recently fragmented and all but collapsed, in part due to financial troubles.
Minor far-left parties: For example the Socialist Workers' Party, the Socialist Labour Party, and so forth. Range from relatively sensible if hysterical to outright apologizing for some of the more authoritarian parts of the far left. The only one to have any electoral success is “Respect - the Unity Coalition”, which is really run by the SWP behind the scenes.
Christian parties: There are several of these, often uniting behind a joint candidate list. They have yet to have much success above the council level. They typically enjoy their highest voting figures in London due to its African and Afro-Caribbean immigrant population. Most prominent among these parties is the Christian Peoples Alliance.
Mebyon Kernow: The Cornish nationalist party, but no-one can stop laughing long enough to take it seriously.
English Democrats Party: Advocate an English devolved parliament. Since the BNP's collapse, has had an influx of defectors and looks to be taking its place as the main far-right outfit.
Official Monster Raving Loony Party: Britain's joke party, remarkably popular. Founded by David “Screaming Lord” Sutch, now deceased. Although deliberately failing to have any electoral success, the OMRLP is now considered such an institution that some have felt led to start other joke parties. Probably the most popular of these newcomers is the Church of the Militant Elvis.