A hardcover will cost around $3-$4 in printing costs. Even still, ebooks can be a good deal. To use a recent example that wouldn't yet have any digital discounts, there's the John Boehner book . As of this comment, it has an MSRP of $29.99. The Kindle version is $14.99. At actual retail, Barnes & Noble charges $23.99. At Amazon it's $17.99, which makes the savings on print costs a wash.
Mid-size paper backs are usually a fair bit cheaper too. Mass-market editions are the bad deals: In print they retail around $8 to $10, which is usually the ebook cost too. However, many books never make it to mass market editions theses days.
The bulk of the costs involved in bringing a book to market are the people: Time to review the "slush pile", pay the author, editor, copy editor, typesetting, marketing. And many books either lose money for the publisher or barely earn out the author's advance. Mid-list authors who can consistently earn out their advance with a healthy margin are the ones that keep the lights on long enough for the publisher to (hopefully) catch lightning in a bottle with a block buster, or at least an outsized success.
Of course all of the costs above assume you're buying a new copy. Used books are often a very good deal.