Currently it's all in a state of flux, because a lot of constitutional re-arrangements are being made and proposed.
Originally the House of Lords had the same function as the first and second Estates in France for instance - to represent the landowning classes and the senior clergy. Membership was usually hereditary (except for the bishops and abbots) but of course new hereditary titles could always be created (and indeed, via bills of impeachment and attainder, got rid of).
However, from the earliest beginnings, the crown was entitled to summon peers into the House for life only (and indeed for just the term of one Parliament). it became rare however - even unheard of - for this to happen, although the title of Prince of Wales is not hereditary.
Acts of Parliament required the assent of both houses as well as the approval of the monarch. This is still technically true, but the monarch hasn't refused a bill in more time than I care to look up, and the House of Lords merely has delaying power (it can amend legilstaion and send it back to the House of Commons) although sometimes delay means the bill has to be abandoned.
In 1958 life peerages were formalised by the Life Peerages Act, and since that time the overwhelming majority of peers appointed have been for life only.
In 1999 most of the 700 or so hereditary peers with the right to receive summonses to Parliament was reduced by statute to 92. That figure is expected reasonable shortly to be reduced to zero.
Meanwhile all life peers are appointed by the government in effect, though the system of appointment is regulated by an independent body. There are proposals around however to elect members of the Lords directly, or to mix appointed and elected peers in different proportions. That may reduce the present tendency for the Lords to take less and less of an independent line.
If that's not enough, the wikipedia entry looks OK