An Einliegerwohnung is a second housing unit in a house that is smaller than the main flat. It is independently accessible, e.g. by a separate entrance or a shared stairwell, but will always be a distinct unit separate from the rest of the house.
It may be partly underground or in the basement, it may as well be under the roof. The name signifies the “importance” in the house, e.g. often the owners of a house would use the main area and rent out the Einliegerwohnung for additional income. It may also be an area used by grown-up children or elderly relatives.
Sometimes the term Apartment (note the spelling!) is used as loanword from English, as it has a similar meaning: small unit. But it is not restricted architecturally as Einliegerwohnung is, you can build a house with many smallish units which all qualify as Apartment.
If a house has many flats, it may have one or multiples per floor, depending on the size of the building. If you rent one of them, you are renting eine (Miet-)Wohnung. The name doesn’t indicate a size or layout, simply the terms of possession.
Should the house have one flat per floor, these may also be called Etagenwohnung. This term indicates the architectural property, but no information on the terms - you can both rent or own one.
Note that there is also the (rarely used) term Appartement (again: spelling!), which is a French loanword indicating a larger, superior unit or a suite of rooms in a hotel.