1. The protection of "proceedings in Parlyament"
Article 9 of the 1689 Bill of Rights provides as follows:
That the Freedome of Speech and Debates or Proceedings in Parlyament ought not to be impeached or questioned in any Court or Place out of Parlyament.In practice, this provision protects a great deal more than freedom of speech, since "proceedings in Parlyament" is given quite a broad meaning. Erskine May's Parliamentary Practice has this to say:
The primary meaning, as a technical parliamentary term, of `proceedings' (which it had at least as early as the seventeenth century) is some formal action, usually a decision, taken by the House in its collective capacity. This is naturally extended to the forms of business in which the House takes action, and the whole process, the principal part of which is debate, by which it reaches a decision.In Re McGuinness's Application  NI 359, Kerr J of the High Court of Northern Ireland took the view that the Speaker's denial of certain parliamentary facilities and services to Martin McGuinness (who had refused to take his seat in the Commons) fell within the ambit of proceedings in Parliament.
An individual Member takes part in a proceeding usually by speech, but also by various recognised kinds of formal action, such as voting, giving notice of a motion, etc, or presenting a petition or a report from a committee, most of such actions being time-saving substitutes for speaking. The Select Committee on the Official Secrets Act in 1938-39 argued that `proceedings' covered both the asking of a question and the giving of written notice of such question, and includes everything said or done by a Member in the exercise of his functions as a Member in a committee of either House, as well as everything said or done in either House in the transaction of Parliamentary business.
2. Exclusive cognisance
This related but broader principle denotes "the exclusive right of each House to manage its own affairs without interference from the other or from outside Parliament" (Lord Phillips in R v Chaytor  UKSC 52, a case in which the Supreme Court refused to allow parliamentary privilege to stand in the way of prosecutions for fraud arising out of the 2009 expenses scandal). It means, in essence, that the internal affairs of Parliament are not subject to the ordinary jurisdiction of the courts except where Parliament has expressly so provided. Blackstone wrote in his Commentaries:
[A]s every court of justice has laws and customs for its direction, some the civil and canon, some the common law, others their own peculiar laws and customs, so the high court of parliament has also its own peculiar law, called the lex et consuetudo parliamenti.... It will be sufficient to observe, that the whole of the law and custom of parliament has its original from this one maxim; "that whatever matter arises concerning either house of parliament, ought to be examined, discussed, and adjudged in that house to which it relates, and not elsewhere."The Joint Select Committee on parliamentary privilege stated in its First Report (1999):
Another aspect of Parliament's right to regulate its own internal affairs concerns the application of legislation to activities taking place within the Houses of Parliament. In 1934 the courts decided, in the A P Herbert case [i.e. R v Graham-Campbell, ex p. Herbert  1 KB 594], that the sale of alcohol in the precincts of the House of Commons without a justices' licence was a matter relating to the internal affairs of the House and that no court had power to interfere. Since then, Acts of Parliament have been taken not to apply within the precincts of either House in the absence of express provision that they should apply. Among the legislation taken not to apply are the Health and Safety at Work etc. Act 1974 and the Data Protection Acts 1984 and 1998. In practice Parliament voluntarily abides by some of these statutory provisions.If this makes it sound like Parliament is above the law, that's because it effectively is. So much was affirmed by Lord Chief Justice Coleridge in Bradlaugh v Gossett (1883-84) LR 12 QBD 271. This was the famous case of the atheist MP, Charles Bradlaugh, who (like Martin McGuinness) had difficulties with the oath required to be sworn by Members. By the time the case reached court, the House of Commons had directed the Serjeant-at-Arms to keep Bradlaugh from entering the House in spite of his apparently having a legal right to do so. Coleridge said:
[I]t seems to be conceded that a resolution of the House of Commons only... cannot change the law of the land.... and yet, if the House of Commons is, — as for certain purposes and in relation to certain persons it certainly is, and is on all hands admitted to be, — the absolute judge of its own privileges, it is obvious that it can, at least for those purposes and in relation to those persons, practically change or practically supersede the law....
What is said or done within the walls of Parliament cannot be inquired into in a court of law.... The jurisdiction of the Houses over their own members, their right to impose discipline within their walls, is absolute and exclusive.His lordship did not claim that Parliament's power in this regard was absolutely limitless, however. He observed that "to hold the resolutions of either House absolutely beyond inquiry in a court of law may land us in conclusions not free from grave complications". Coleridge's fellow judge, Stephen J, had this to say:
I think that the House of Commons is not subject to the control of Her Majesty's Courts in its administration of that part of the statute-law which has relation to its own internal proceedings, and that the use of such actual force as may be necessary to carry into effect such a resolution as the one before us is justifiable.In more recent times, some doubts about the extent of Parliament's immunity to the enforcement of the law have been expressed. In 1984, for example, three law lords who were members of the House of Lords' Committee for Privileges (Lords Diplock, Scarman and Bridge) affirmed that that Sections 2 to 6 of the Mental Health Act 1983 applied to members of the House of Lords.
3. The enrolled bill rule
This is the principle that the courts cannot call into question the validity of an Act of Parliament on the basis of matters connected with its progress through Parliament. It was enunciated by Lord Campbell in the famous case of Edinburgh and Dalkeith Railway Company v Wauchope (1842) VIII Clark & Finnelly 710. His lordship said:
All that a Court of Justice can do is to look to the Parliamentary roll: if from that it should appear that a bill has passed both Houses and received the Royal assent, no Court of Justice can inquire into the mode in which it was introduced into Parliament, nor into what was done previous to its introduction, or what passed in Parliament during its progress in its various stages through both Houses.The idea that this was not the case apparently derived from Scots law. The future Megarry J speculated in his first Miscellany-at-Law (1955) that the principle might not apply in cases where it was clear that a bill had not been approved at all by one of the component parts of Parliament (an unlikely eventuality, but one which has in fact happened).
The decision in Wauchope was subsequently echoed in Lee v Bude and Torrington Railway Co (1871) LR 6 CP 577:
If an Act of Parliament has been obtained improperly it is for the legislature to correct it by repealing it; but, so long as it exists the courts are bound to obey it.In more recent times, Wauchope was cited with approval by the House of Lords in Pickin v British Railways Board  AC 765.
Additional note (12 January 2012)
Some more source references:
"[I]t behoves the court to be ever sensitive to the paramount need to refrain from trespassing on the province of Parliament" (Sir John Donaldson MR, R v HM Treasury ex p Smedley  QB 657)
"Activities of Parliament are accepted in general ... to be not subject to judicial review." What the defendant was doing "directly related to what happens in Parliament." (Lord Woolf MR, R v Parliamentary Commissioner for Standards ex p Al Fayed  1 All ER 93)
"The propriety of exercise by each House of one of its established privileges is a question, not for the Court, but for each House alone." (Holdsworth, A History of English Law, vol. 10, p539)
"The House has the right to control its own proceedings and to regulate its internal officers without interference by the Court." (Bradley, Constitutional and Administrative Law (11th ed.), p231)
"The courts take the view that it is for them to determine whether a parliamentary claim to privilege in a particular case falls within that area where what is claimed is necessary to the discharge of parliamentary functions or internal to one or other of the Houses in which case parliamentary jurisdiction is exclusive." (Halsbury's Laws, vol. 34, para. 1006)