It was first used as the title for several of Aristotle’s works, because they were usually anthologized after the works on physics in complete editions.
The prefix meta- (“beyond”) indicates that these works come “after” the chapters on physics.
However, Aristotle himself did not call the subject of these books “Metaphysics”: he referred to it as “first philosophy.”
The editor of Aristotle’s works, Andronicus of Rhodes, is thought to have placed the books on first philosophy right after another work, Physics, and called them τὰ μετὰ τὰ φυσικὰ βιβλία (ta meta ta physika biblia) or “the books that come after the [books on] physics”.
This was misread by Latin scholiasts, who thought it meant “the science of what is beyond the physical”.
However, once the name was given, the commentators sought to find intrinsic reasons for its appropriateness.
For instance, it was understood to mean “the science of the world beyond nature” (phusis in Greek), that is, the science of the immaterial.
Again, it was understood to refer to the chronological or pedagogical order among our philosophical studies, so that the “metaphysical sciences” would mean “those that we study after having mastered the sciences that deal with the physical world” (St. Thomas Aquinas, “In Lib, Boeth. de Trin.”, V, 1).
There is a widespread use of the term in current popular literature, which replicates this error, i.e. that metaphysical means spiritual non-physical: thus, “metaphysical healing” means healing by means of remedies that are not physical.