In addition to tape recorders (or 'decks') for analog audio signals, conceptually similar but bigger and more expensive reel-to-reel magnetic tape drives for digital data were used by earlyish (about 1950-1980) computers; see https://en.wikipedia.org/wiki/9_track_tape for some examples. Note these were almost always mounted vertically; some audio decks also were vertical, especially if they were intended to be mounted in equipment racks along with other related electronic devices like amplifiers, receivers, transmitters, signal processors, etc.
Because computers in those days had very small working memory by today's standards (less than modern microprocessors have in L1 cache) they generally needed to read and write magtape data 'blocks' separately; this required the ability to quickly accelerate the tape from being stationary to fast enough to read or write, keep it moving at high but constant speed, then equally quickly decelerate it to a stop, all without putting stress that would stretch (or even break) the tape.
Some lower-speed drives did this with spring-tensioned mechanical follower or 'idler' arms, similar to user287001's answer, but most used so-called vacuum columns. These pumped some air out of a closed channel so that a modest pressure difference (not a true vacuum) would hold a U-shaped 'loop' of tape at its full length, with little stress. As tape was moved past the heads by the capstan, one loop would get longer and move down the column while the other would get shorter and move up, and pressure sensors in the columns would detect these movements and turn on and off the reel motors as needed to supply more tape to the now-short loop and 'take-up' tape from the now-long one.
Nerds in those days (including me) would jeer at movies and TV shows which would often show purported computers and tape drives, but have both reels spinning continuously at the same speed, when real ones turned in short jerks, independently and separately, under control of the vacuum-column or idler sensors.
When microcontrollers became capable enough around 1980, there were some 'streaming' drives for what was then considered 'standard' magtape, which used more complicated control algorithms to drive the reel motors directly, with slow enough acceleration and deceleration to protect the tape, and much larger buffers to usually allow reading and writing many blocks at a time. However by this time disks had become (much) bigger and cheaper and replaced tape for most data storage, and for backup and transport much smaller (but higher-density) cartridge and cassette tape formats were developed and largely replaced 'reel' tape.