What is the history and origin of the term 'Theater of the Mind', as used in 5e?
Where does TotM come from?
"The theatre of the mind" comes from radio jargon, where the term indicates the collected ability, styles, tools, and techniques by which radio performers conjure vivid imagery in their audiences' minds through sound alone. It's used to contrast radio against visual mediums like plays, films, and books, which use additional sets of tools to conjure imagery. Orson Welles' famous War of the Worlds broadcast was part of a series of radio dramas called "The Mercury Theatre on the Air," and Steve Allen quipped, "Radio is the theater of the mind; television is the theater of the mindless."
When did TotM become an RPG term?
It's difficult to say exactly when the term first jumped mediums from radio to tabletop RPGs; likely it jumped multiple times over many years in different fragmented corners of the RPG community. The phrase certainly has been around for a good while--a company called Theatre of the Mind Enterprises sold call-of-cthulhu supplements in the early 80s, and White Wolf first published their world-of-darkness LARP system minds-eye-theatre in 1993. Neither CoC nor White Wolf made heavy use of the miniatures-on-grids paradigm--and neither did a lot of early D&D campaigns, though D&D has always included rules for miniature combat.
By early 2012 the term was ubiquitous enough that Wizards of the Coast used it in dnd-5e's beta material (then dnd-next) without elaboration (eg in the Caves of Chaos beta adventure), though they did quotate the phrase while leaving phrases like "hack-and-slash" and "cloak-and-dagger" free of scare quotes. (Often those quotes indicate a recent loan phrase from another language or discipline, not unlike italicising a recently-adopted foreign word, but I'm not sure what WotC meant by it.)
What's it used for?
Today "theatre of the mind" fills the need for a distinction between play styles which use interactive physical props as a primary focus, and play styles which do not.
With the d20 System's ubiquity, the proliferation of Friendly Local Game Stores, and because early RPGs grew out of tabletop wargames, at some point it became a common assumption that visual/physical aids like models and maps are necessary to conjure and share a scene's imagery and to make sound tactical choices. A term was necessary to call out games (systems, campaigns, groups) which instead primarily use the spoken word to conjure those scenes.
That said, the fragmented nature of the RPG community means you'll quickly find three people with five conflicting opinions about what TotM means; when in the history of RPGs it's been most common; and whether it's antithetical to a grid-and-minis play approach. In particular there are folks who consider all RPGs to be forms of TotM, and that grids-and-minis are simply an assistive aid to TotM play during tactical combat.
The term as used in radio and RPGs is unrelated to similar psychological terms; those are mostly about ways to think of brain/body interactions, not about a story's semiotic tools.