Most of the time, deponent verbs in Latin come from the Indo-European middle voice, which had pretty much completely died out by Classical Latin times. But in other Indo-European languages, such as Ancient Greek and Hittite, the middle voice is well-attested: it's a third voice next to active and passive, which usually links the subject back to itself in some way.
In Latin, as opposed to those other languages, the middle voice as a distinct thing died out fairly early. After that, the passive voice (descended from the PIE medio-passive) was almost always a true passive, and middle meanings were expressed by adding extra words.
However, there were some words which were only ever commonly used in the middle voice, never in the active. For example, *s-kʷ- "follow" seems to be this way all the way back to PIE: compare Ancient Greek ἕπομαι (hépomai) and Old Irish seichithir, which never appear in the active voice. So in Latin, you end up with sequor, a form with passive morphology, but non-passive semantics. It can even take a direct object, which true passives can't do!
In Romance, this little irregularity got smoothed out: sequor gave way to *sequiō, a normal verb with normal active morphology. Most other deponents changed in the same way, or died out and were replaced by non-deponents. They were an irregularity in the system, and like most irregularities, the constant and unceasing process of language evolution ironed them out over the centuries.
On the flipside:
Latin also has some verbs that are active in form but passive in meaning.
To me, this seems just plain misleading. Fiō means "become", and it's not inherently passive any more than English "become" is.
Instead, faciō was a suppletive verb, just like ferō, feriō, sum, and others—that is, some of its forms fell out of use, and other verbs were used in their stead. In this case, it was specifically the present-system passives: instead of *clarus facier, "I am made famous", clarus fiō, "I become famous".