What can happen in an "unlawful detainer (eviction) action"?
When a landlord wants to have a tenant removed from rental property, either due to the tenant's default or because a tenant refuses to leave at the expiration of the lease term, the landlord must get the assistance of a court of law. ("Self-help" eviction, as explained above, is abhorred and could result in the landlord having to pay damages to the tenant, and possibly be convicted of a crime).
The first step is for the landlord to file pleadings (legal papers) with the court and pay the required filing fee. Then the tenant must be served with the pleadings (although most jurisdiction allow "nail and mail" service in the event that a tenant avoids being served). Once service has been made on the tenant, the lawsuit can proceed (the tenant has a constitutionally protected due process right of notice and opportunity to be heard). An unlawful detainer action is typically a "summary proceeding" which can move rapidly through a court system.
In the event that the tenant loses the lawsuit (the tenant will lose if s/he fails to show up at the scheduled court hearing), the landlord may be given a monetary judgment (such as for damages to the premises, the amount of money owed for rent, plus attorney fees and costs) plus a writ of possession. A writ of possession may then be executed by the local marshal or sheriff so that the tenant is removed from the rental property and then the landlord is once again given possession. In some jurisdictions, it is possible that the landlord is given possession of the rental property but the tenant continues to be responsible for the payment of rent to the end of the lease term (although the landlord would have an obligation to make a good faith effort to re-rent the rental property so as to mitigate the damages sustained due to the tenant's default).
In an unlawful detainer action, a tenant has certain defenses, such as "constructive eviction" , default by the landlord of the implied warranty of habitability, or a "retaliatory eviction", which occurs when the landlord takes an action against a tenant for trying to exercise rights as a tenant (such as informing government agencies of code violations or complaining to the landlord regarding repairs that must be made to maintain the rental property in habitable condition).