Ejectment is the common law term for civil action to recover the possession of and title to land. It replaced the old real actions as well as the various possessory assizes. Though still used in some places, the term is now obsolete in many common law jurisdictions, in which possession and title are contested via the actions of eviction and quiet title, respectively.
Originally, an ejectment was concerned with the recovery of possession of land, for example against a defaulting tenant or a trespasser, who did not have (or no longer had) any right to remain there. It has continued to be used for this, though in some jurisdictions the terminology has changed.
The old real actions, which were concerned with the title to land, were found to be too technical and difficult to use. The practice thus developed of trying the title to ownership of land, by means of an ejectment. The practice was for the claimant to grant a lease to a friend and later to a fictitious person (such as John Doe). An action was brought in the name of this tenant often against another fictitious person (often Richard Roe) who had allegedly evicted him.
A letter was then sent in his name to the real defendant, inviting him to defend the case on behalf of his supposed tenant (a fictitious defendant). The true defendant's right to appear depended on the existence of the fictitious lease (whose existence he thus could not deny). This enabled rights of the true claimant and defendant to be litigated. Such fictitious actions have been abolished in many jurisdictions as a result of the provision of alternative remedies.