Translated by Charis Messier
Japanese Encyclopedia: Kotatsu, Horigotatsu (Table Heater, Sunken Table Heater)

Written by k_yamamuro
An explanation of Japanese terms for tourists. This article is on the history of Japan's widely-used heaters: the kotatsu and the sunken kotatsu.
A kotatsu is a type of home heater. It consists of a low table, placed over an electric heater and covered with a futon (a quilt or heavy blanket) that traps in heat. You can warm your lower body by sitting at the table, and relaxing under the blanket. A sunken kotatsu (hori-gotatsu) is another style of the kotatsu, incorporating a recessed floor into which the heater is placed. Being able to sit in a chair and dangle your feet into the warmth below is an experience unique to the sunken kotatsu.

Source: Taito Ryokan, Asakusa: Vintage 1950s Japan
Origin of the Kotatsu
In the past, people used to warm themselves at a sunken hearth (known as irori in Japanese. The irori refers to the square they would cut out of the floor and light a fire in). Unfortunately the sunken hearth was not able to warm up the entire body, and so around the end of the 14th century, they devised a wooden frame (called yagura) to place over the dying embers of the fire, and placed a quilt on top of that to keep the heat from escaping. This is thought to be the origin of the kotatsu.

Source: IRORI Nihonbashi Hostel And Kitchen – The Guesthouse With An Irori
In the 17th century, the heater was made portable by putting the hot charcoal in earthenware or china. This transportable home heater was known as an anka (a type of foot or bed warmer), and is the predecessor of the modern kotatsu.
In the 1950's, the kotatsu switched to electricity as its heat source, as opposed to using charcoal and briquette. The electric kotatsu quickly spread through Japanese households.

Source: Enjoy Old-Style Japan at Gonpachi G-Zone Ginza
Lifestyle Change and the Kotatsu
Until the 1980's, every household had an electric kotatsu and going under the kotatsu's quilt to eat mandarin oranges became a customary winter scene. The influence of Western style on modern Japan has made it commonplace for households to use stylish low tables and kotatsu outside of the winter months as well.
Households without a kotatsu have increased in number due to the spread of other types of home heaters in recent years. But, Japanese-style restaurants and izakaya often have seats surrounding a sunken kotatsu, allowing the majority of Japanese to enjoy the kotatsu experience there.