Print-on-demand services are a relatively recent phenomenon, and are due to a revolution in printing technology.
Until very recently we were still using the same basic printing technology as that invented by Gutenberg in the 15th century! That technique involved setting metal letters in order as per the required text to create a mould or form. That was then inked and stamped onto the paper.
Of course those letters were placed electronically nowadays rather than manually, but still the basic principle was the same. So the initial labour (i.e. setting the type, literally typesetting) was very high, and therefore you had to do a big print run to get the unit cost down to anything reasonable.
But now with computers it’s easy to print just one copy of anything. And that’s where print-on-demand services come in. They are exactly what they say: print-on-demand.
In many ways they put the power in the hand of the author. He or she can go onto the website of one of the print on demand publishers and within minutes have his or her novel ready to be printed and dispatched. It’s very exciting!
One problem, however, with print-on-demand services is that the unit cost of each book can be much higher than with traditional publishing. It's hard to give an example as there are so many factors to consider, but it wouldn't be unusual to have a unit cost of say $1.00 or $2.00 for traditional publishing and the same book costing maybe $12.00 to publish using print-on-demand service.