Ejectment is the common law term for civil action to recover the possession of or 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 (or claim to have granted) a lease to a friend, and later to a fictitious person (such as John Doe), who became the nominal plaintiff: the real claimant was then known as the "lessor of the plaintiff". An action was brought in the name of this fictitious tenant, either against the real defendant or, more usually, against another fictitious person (e.g. William Styles), known as the "casual ejector", who had allegedly evicted him on the strength of an equally fictitious lease granted by the real defendant. The title of the action would then be "Doe dem. [name of real claimant] v. Styles".
A letter was then sent in the name of the casual ejector to the real defendant, inviting him to defend the case on behalf of his supposed tenant. The true defendant's right to appear depended on the existence of the fictitious lease (whose existence he thus could not deny). This enabled the 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.