The concept of peerage was created in the 12th c., by Louis VII (1137-80), who decided to elevate some of his vassals, both clerics and lay, above all others. The peerage was a dignity attached to a specific fief (and therefore title), and was transmitted the same way the fief is transmitted. The ecclesiastical peerages were attached to the see. Peers played a role in the liturgy of the coronation (or rather sacrement, "sacre") of the kings of France, symbolically upholding his crown. Each peer played also a specific role.

Coronation of Charles V in 1364 (France, Bibliothèque Nationale). Notice the spiritual peers to the right and the lay peers to the left. Each wears a coat of arms for identification: to the left, Flanders, Étampes, Toulouse; to the right Anjou (holding the sword), Châlons, Beauvais.

Coronation of Jeanne de Bourbon, wife of Charles V, in 1364 (France, Bibliothèque Nationale). To the left, Bourgogne and Bourbon; to the right, Châlons, Beauvais.
The original peers (pairies anciennes) were 12 in total, 6 ecclesiastical or spiritual and 6 lay or temporal. They were, in order of precedence and with their function at the coronation ceremony:
the archbishop-duc de Reims (anoints, crowns)
the bishop-duc de Laon (carries the Sainte Ampoule)
the bishop-duc de Langres (scepter)
the bishop-count of Beauvais (mantle)
the bishop-count of Châlons (ring)
the bishop-count of Noyon (belt)
the duc de Bourgogne (carries the crown, fastens the belt)
the duc de Normandie (holds the first banner)
the duc d'Aquitaine or Guyenne (holds the second banner)
the count of Toulouse (Languedoc) (carries the spurs)
the count of Flandres (carries the sword)
the count of Champagne (holds the standard)
In the coronation ceremony, the archbishop of Reims would apply the Holy Oil taken from the Ampula onto the forehead of the king, using a scapula. The unction, rather than the coronation, was the defining moment of the ceremony.
The privileges of the peers were actually not that important, aside from precedence. Judicial matters pertaining to them (and to the fiefs to which peerage was attached) were solely under the jurisdiction of the court of peers, which later was incorporated into the Parliament of Paris.
The first coronation with peers playing their parts took place in 1179, when Philippe II Auguste was crowned while his father was still alive. On that occasion, two sons of the king of England took part (Henry, duc de Normandy, who died in 1183, and Richard Lionheart, as duc de Aquitaine). [Note: there is some doubt expressed on the authenticity of the document that describes this coronation. The earliest certain mention of the peers is 1216, and the first full listing of the twelve peers is dated 1275.]
The Creations of Peerages
Late Medieval (14th-15th c.)
By the early 14th c., a number of the original lay peerages had disappeared:
Normandy was confiscated on John of England in 1203, as endorsed by the treaty of Paris in 1258;
Aquitaine was confiscated in 1203 as well, recreated as the duchy of Guyenne by the same treaty. Confiscated again in 1294, it was returned in 1303, taken back in 1347, returned in 1360, taken back finally in 1370 and united to the crown.
Toulouse was united to the crown in 1271 by marriage;
Champagne was united to the crown in 1316 by marriage. As the crown passed in 1328 to a male heir over female heirs, Champagne should normally have been separated again, but in 1353 the claimant relinquished all claims and Champagne was forever united to the crown in 1361.
Flanders was confiscated in 1299, though returned in 1303.
The ecclesiastical peerages had no reason to disappear, of course. A 7th one was created in 1690 for the archbishop of Paris, duc de Saint-Cloud, who ranked behind the original ones.
Beginning in 1297 with Artois, Anjou and Bretagne, the king created new peerages for princes of the blood who held an apanage (by 1328, all apanagists were peers). The creation took the form of letters patent, which specified the fief to which the peerage was attached, and the conditions under which the fief could be transmitted. The first peerage to be restricted to males was Poitou in 1314. Many later peerages were "male" (as opposed to "female" or inheritable by females), but not all. In medieval times, women who inherited peerages were considered peers, and took place and rank as peers, including in the court of peers. In modern times, women peers did not take seat in Parlement as men peers did, but otherwise enjoed the same honors and privileges. The letters patent creating the duchy-peerage of Randan for Anne de La Rochefoucauld-Randan in 1661 specify: "pour être dorénavant et à toujours possedé et en jouir par [elle] aux honneurs, autorités, rang, séance, prérogatives, prééminences, franchises, libertés et autres immunités appartenant audit titre et dignité [...] tout ainsi que jouissent les autres ducs et pairs du royaume, même ainsi que les possèdent les duchesses et pairs qui ont obtenu cette grâce".
Until the 1420s, creations of peerages were exclusively in favor of princes of the blood, with a few occasional foreigners. Charles VII created a few peerages for foreigners, Scotsmen who had helped him fight the English, but peerages for non-royals remained very rare. Also, by far most new creations were not baronnies and counties (80% in the 14th c., 93% in the 15th c.), as opposed to duchies.
Early Modern (16th-18th c.)
It is really in the 16th century that peerages begin to be created for non-royals (the first peerage created for a French non-royal nobleman was in 1519, but the first registered peerage for a French non-royal occurred in 1551). The only counties-peerages created in the 16th c. were as parts of apanages (an arrêt of the Parlement of Paris of 1561 had decided that all apanages were henceforth to be held as peerages), Le Perche in 1566 and Dreux in 1569; after that date, peerages were duchies. Many of the peerages were created for maréchaux de France or generals. Others were created for powerful ministers and their families (Sully, Richelieu, Mazarin, Fleury, Choiseul). Others still were for the sovereign's mistresses or their families (Beaufort, La Vallière, Antin) and for their illegitimate children (Vendôme, Angoulême, Aumale, Penthièvre).
Territorial Basis of a Peerage
It is extremely important to understand that, in Old Regime France, titles were always attached to a fief, that is, a territorial basis; the owner of the fief, if he was noble, was the holder of the attached title. Without owning the fief, no one could hold the title. This territorial requirement was formalized for peerages by an edict of March 1582, which required a minimum income of 24,000 livres from the estates that were to form the basis for the peerage.
Upon extinction of the peerage, the estates which had formed it were to revert to the Crown, by the terms of the Edicts of July 1566 and March 1582. In fact, every single letters patent of creation of a peerage contained a waiver (the only exception until 1789 being the duchy-peerage of Châteauroux in 1743). Thus, upon extinction of the peerage, the estates returned to their prior rank and were inherited according to the prevailing laws and customs.
Estates held in peerage of the king became immediate fiefs of the Crown (relevant de la Grosse Tour du Louvre), no matter what their previous status was. One exception occurred with the peerage of Aiguillon, which an arrêt of 1604 maintained as a fief of the county of Agénois (held at the time by the king's sister) which was its status prior to becoming a peerage.
Transmission of Peerages
Medieval
All original or feudal peerages could be held, and transmitted by females, just as any other feudal office. As late as 1603, the jurist René Choppin (Traité du Domaine) states: "par la Coustume de France, la fille exclud les proches parens ès fiefs de Duché ou Comté, encore qu'ils soient érigez en Pairrie [...] les femmes succèdent aux Pairries de France, comme jointes et unies au fief". But, of course, for created peerages, the letters patent creating the peerage usually specified the remainder. It might be a life peerage for one person (Rethel in 1405) or several specified individuals (Nevers in 1347), transmissible by males (Poitou in 1314) or both males and females: that is, the peerage passed to the closest female heir in absence of a male heir. If the remainder was to heirs of the body without specific restriction to males, it was assumed to be female. One unusual remainder was specified for Normandie, which began to be used in the 14th c. like the title of Prince of Wales in England: created for the eldest son of the king, with automatic extinction upon accession. But with Jean II's son, the title of Dauphin was adopted instead and remained the title of the heir apparent until 1830.
References
Jean Favier: Dictionnaire de la France mediévale. Paris, 1993; Fayard.
Jean-Pierre Labatut: les Ducs et les Pairs en France au 17e siècle.
Christophe Levantal: Ducs et pairs et duchés-pairies laïques à l'époque moderne (1519-1790). Paris, 1996; Maisonneuve et Larose. (Note: this monumental work (1218 pages!) is a phenomenally complete. down to the record number in the National Archives for the marriage contracts of every peer. This is the absolute reference for the peerage in the modern period.)
Marcel Marion: Dictionnaire des institutions de la France aux 17e et 18e siècles. Paris, 1927; Picard.
Anselme, Père: Histoire généalogique et chronologique de la Maison Royale de France, des Pairs, grands officiers de la Couronne et de la Maison du Roy et des anciens barons du Royaume ... Paris, 1726-33; reedited Paris, 1967; Ed. du Palais-Royal.
Warren, Raoul de: Les pairs de France sous l'Ancien Régime. Paris, 1958; les Cahiers Nobles.
Saint-Simon: Mémoires, ed. Boislile, vol. 2 app. 1, vol. 22 app. 7.
Encyclopédie, ou Dictionnaire Raisonné des Arts et des Sciences. s.v. pair.
Dominique and Michèle Frémy: Le Quid. Paris, 1993: Laffont.