"Peer review? I thought that's why we have the House of Lords." - Bruce Lancaster, Librarian
Eighteenth-Century Origins: Gentleman Scholars
Peer review developed in the mid 18th century as part of the development of aristocratic "learned societies" and royal academies.
Such bodies were venues through which self-styled scholars (many of them aristocrats and nobles, all of them Very wealthy males) could share their findings.
Entry into these bodies was extremely selective and difficult, in some cases requiring appointment by a member of the royal family, and publication in their journals (called "proceedings") was even more difficult.
To enter these organizations, applicants were reviewed by the "peers" of the society, and only their equals were allowed to join.
In Britain, a "peer" is also the title for a member of the nobility ("peer of a realm"), which is fitting -- many members of the Royal Society, for example, were literal Peers too.
Nineteenth Century Growth: Early Academics
In the 19th century, what we might recognize as modern journals slowly developed. In the US, a notable example was American Journal of Science (1818) by Yale professor Benjamin Silliman. Journals like Quarterly Journal of Education (1831-1835) in the UK would only publish articles that were reviewed by other subject experts. Its editor George Long, a professor at U.London, would only publish a work in 1831 if it was reviewed by “authorities . . . able to judge of the [sic] accuracy of [the author’s] work" and he required “opinion of some scholar” before publishing articles.
While university professors were now taking control of scholarly publishing, old biases still existed. When University of Virginia chemistry professor John Patten Emmet (1825-1842) tried to publish a 1841 paper that critiqued Newton's theory of light refraction, it was immediately dismissed without review and returned unread by a British journal, according to his colleague Prof Geo. Tucker, "on the ground that it was an absurdity to attempt to controvert any of Newton's views." That he was an American, too, surely counted against him. Ironically, Newton's theory on optics has been since disproven.
Twentieth Century: Professional Scholarship
The early 20th century includes many marks of what we consider the "modern" academic profession: the research university; widespread adoption of PhDs; tenure; a tiered professorship model; millions of dollars in federal funding for research; "publish or parish" mentality. This all has a major impact on peer review. Faculty need to publish in recognized peer reviewed journals for tenure or to receive grants, and the number of academics increases considerably. Quality of scholarship also improves and has to improve, so it becomes increasingly important to have works reviewed and edited by other subject experts. In the mid 20th century we see the rise of the modern academic publishing industry, which leads to demand for more authors, more reviewers, and more journal readers. What might well be regarded as the "modern" academic publishing model really develops after WW2, when a boom in university growth, federal research funding, and massive growth in the professoriate, creates a large academic publishing market.
Twenty-First Century: Endless need for peer reviewers
As scholarship becomes more nuanced and publishing costs decrease, the number of specialized journals grows. This is further fueled by an ever-increasing number of PhD graduates competing for ever fewer professorships, all of whom try to publish to obtain an elusive tenured position in academe. Open Access journals, often published by universities, have also helped establish niche journals that 20th century academic publishers would not have supported due to their lack of profitability. This all leads to an ever growing need for peer reviewers.
The twenty-first century also brings interesting challenges for peer review. Among the public, there is a distrust of expertise; when told economists predicted [rightly, it turned out] that Brexit would be an economic disaster for the UK, the British Lord Chancellor declared "I think the people of this country have had enough of experts." In academe, too, there are questions about the previously unaddressed biases in the peer review process too.