A demiplane is a term introduced in the Planescape setting for Dungeons & Dragons. In a nutshell, it refers to a "miniature" plane, one featuring well-defined limitations as opposed to extending on to infinity in all directions, having variable gravity and time traits, etc. Demiplanes can be big - Sigil is technically a demiplane - but are usually associated with small sizes, from "big as a large room" to "the size of a mansion".
Creating demiplanes is a popular past-time for high level wizards, as it essentially lets them create their own personalized pocket of reality. With enough time and investment, a demiplane can grow into a full-fledged world in its own right.
The concept of demiplanes has been around since the earliest days of the game, but it was mostly an example of DM fiat in creating pocket dimensions for all kinds of crazy adventures. Examples include the original Ravenloft module (I6), Dungeonland (EX1) and its sequel The Land Beyond The Magic Mirror (EX2). There's really nothing substantial about these places, just the vague notion that they are created by powerful (usually long-lost) magical techniques.
In the early days of 2nd edition, demiplanes still remained a DM tool; adventures like Isle of the Ape (WG6) continued in the same vein as the prior edition.
All that changed with Planescape. In The Planewalker's Handbook, demiplane seed was available as an 8th-level spell to mages. That book, and A Guide To The Ethereal Plane established that these "minor" demiplanes had to be created on the Ethereal Plane (probably because it was considered something of a proto-reality plane). The process was pretty arduous, involving a pretty pricey gemstone and 100 days of spellcasting and other work, but otherwise, it did what it said on the box: you created your very own demiplane to fill with traps, treasure, whatever you felt you needed to keep up with.
There was also a 9th-level spell called demiplane decay that could destroy demiplanes under specific conditions, but it was pretty horrible overall; anyone who couldn't plane-hop out of the place was dissolved with the rest of the plane in the very end.
Special "major" demiplanes were beyond the scope of any mortal magic, and were mainly the province of divine-level beings.
Demiplanes made a definite comeback, but there was a lot of weird stuff throughout the edition. The first appearance was in the 3.0 Manual of the Planes: the planeshifter prestige class gained access to the ability demiplane seed at 10th level.
The next mention of making demiplanes was in the Epic Level Handbook, under the genesis 9th-level spell, available only to wizards or clerics with the Creation domain (until the domain was reworked in 3.5). It was costly at 5,000 XP and a week's casting time (8 hours/day), but you didn't have to take some arbitrary class to get to it; it still had to be done on the Ethereal Plane as in 2nd edition.
In 3.5, genesis was also made a 9th-level psionic power, restricted to Shaper psions, who got it for a much less stringent 1,000 XP and could be created on the Astral Plane.
Oddly, there is one final source for creating a demiplane: the 9th-level general cleric spell word of genesis, which had a truename component (basically, you had to buy ranks of a specific unique skill and pass a check at DC 50; yeah, it was about as well-written as the rest of the Truenamer section).
It should be noted that you don't really have to use such powerful magic to get yourself a little pocket dimension, at least temporarily. Rope trick has long been regarded as an infinitely useful "rest area" spell in dungeons, and Mordenkainen's magnificent mansion is even better, giving access to plenty of food and space for various tasks (along with a very long duration at the time you get access to it). In fact, there is a somewhat obscure reference in Complete Scoundrel to a permanent mansion effect (the headquarters of the Blind Tower criminal organization); given that the permanency spell even mentions that you can research certain spells to be made permanent, and that it costs a pretty pinch of XP to make any high-level spell permanent, it's not a far-fetched notion for a DM to approve such a thing. But there is a downside: the thing can be dispelled, causing all the contents - and guests - to spill out of it, so be advised.
When Pathfinder was a 3.5 setting it added the Genesis spell, which was pretty much the psionic power of the same name as a spell, exclusive to Clerics of the Artifice domain. When Pathfinder became a setting, it ignored all off the previous methods, even though all three were OGL, and even created a new version of the artifice domain without Genesis in the core rulebook.
This would be rectified in Ultimate Magic. Printed in that book was the spell Create Demiplane alongside its lesser and greater variants. Demiplanes now come online much earlier than they did before, requiring only 7th level spells and a cheap focus to create. On the downside, a demiplane now has a limited duration unless you cast permanency it, ensuring only Wizards and Clerics of an obscure subdomain get access to permanent ones. You are also limited to what traits you can select for your plane, so some of the cheese is off limits.
Demiplanes For Fun And Profit
Even as early as 2nd edition, one can use a demiplane for all kinds of fun stuff.
The most basic use is to make your own private homestead or farm: the bottom of the demiplane is the ground, the top is the "sky". Give it a nice, moderate temperature good for crops and livestock, normal day/night cycle, basically the most ordinary environment you can. You want access to spells like control weather and plant growth to kickstart your first few years of crops, but if you keep careful control of the demiplane's environment, you automatically bypass several problems farmers contend with: various diseases and blights, pests/vermin, poor weather, natural disasters, etc.
Another option is to run a big ol' business out of the place. This is a great option in big cities where real estate is at a premium. Buy a small, cheap property, and install portals going to the demiplane where you put in all your manufacturing or services for your business. Now, most folks know this option is how a lot of wizards run their wizard towers, where the outside is smaller than the inside, but don't let yourself be limited to that old cliche. Imagine a little shack that runs the city's biggest tavern, inn, brothel, and casino, a vast pleasure palace.
All of this is enhanced with additional magic to provide labor and resources. For example, if you can summon up a djinn, even for just a short time, you can create permanent plant-based materials; while this stuff could theoretically be dispelled (a nuance that comes up in 3rd edition), that still means you can conjure up firewood, which by itself is a big fucking deal. (Why? Because you don't have to chop down trees for it now. This curtails a lot of effort to acquire fuel, as well as making a LOT of side folks like druids, elves, and sylvan creatures happy that you aren't cutting down their forests.) You can use permanent image to create decorations; in 2nd edition, these are difficult to change, but in 3rd edition the caster can change them at will, allowing for redecorating for special occasions.
Throw in some choice magic items, constructs, and other permanent effects, and you have a real piece of work to call home. Best part is, this provides a luxurious place for your favorite NPCs to come hang their hat. Any cohorts, followers, and loyal hirelings can be given room and board, either for some work on your behalf, or possibly even just to spend the rest of their days enjoying life.
Now, before you get super excited to try any of this, note that all this falls on the DM to approve of, and some may not want to bother with the whole thing. Having said that, if you are a DM, then this is a pretty good way to motivate your players to go on adventures to acquire the treasure needed to pay for all this kind of stuff. Nothing like a spare dragon hoard to fund the ultimate retirement plan, after all.
The most attractive feature of the demiplane is the fact that it's damn hard to find out about. All but the most powerful divination effects can't cross planar borders. Only a few effects can take you there (unless there's a portal somewhere); you can theoretically wander the Ethereal or Astral Planes looking for curtains/pools that lead to the right demiplane, but even if you find one, the chances you found the correct path to the correct demiplane are worse than the chances of a "good" result of using a rod of wonder. Security like that is at a premium at the higher levels, and can be stacked with other effects to make it even better.