Publishers usually describe any book set between the years 1793 - 1830 as a Regency, because books set in this time period are in a recognisable style, but the real Regency was much shorter and ran from 1811-1820.
It was made necessary by the illness of George III, who suffered from a strange malady which the doctors of the time attributed to madness, although modern doctors, studying the symptoms, believe it was porphyra. He talked very rapidly for hours and hours, his words making no sense, and often talking to people who weren't there. His behaviour was unpredictable and he had strange fancies, for example, thinking London was being flooded.
He suffered several attacks during his lifetime, and each time he recovered suddenly after a few months of illness. His attack in October 1810 led to the adjournment of Parliament, and, according to Walter Scott, it led to 'a dull publishing season' because the King's illness was worrying everyone. If he didn't recover, there would have to be a Regency, with the Prince of Wales as Regent.
The King didn't recover, and on February 5th 1811 the Regency Bill was passed. The Prince of Wales became the Regent for his father, ruling in his stead. It was an unsettled time politically. The King could recover at any moment and go back to his duties, relegating the Prince of Wales to the sidelines, or he could remain incapacitated for ever, leaving the Prince of Wales as, in effect, the King. In the event, the King never recovered and the Regency lasted until his death in 1820, when a Regency was no longer needed, and the Prince of Wales became King George IV.
That short period of time became synonymous with elegance, beauty and wit and gave its name to one of the best-loved literary genres of the last 200 years.