Sometimes a landlord needs to sell off a rental property and sometimes they still have their tenants in when the decide to list. For some landlords that are carrying a loan on the property, they may need to have the rental income to maintain the operating costs on the property. Ideally have the tenant move out first and prepping the home for sale is going to yield the best price for the seller. But things are not always ideal.
For sellers keeping a tenant on through the listing there are many hurdles. First the tenant has a right to 24 hours notice before any showings (Washington State). The seller may want to make a written agreement with the tenant to cooperate with agents for showings and keep the property spiffy with a lower rent payment as the "carrot" of inducement during the listing period.
Tenants can also be notoriously unreliable when they know they're on the way out. This can lead to closing delays if they are unable to move out in time, difficulty in showing the property and other setbacks to selling.
I have found that a financial inducement to perform is usually pretty effective. Listing agents and buyer's agents should also council both parties to these potential side effects of a transaction for a property with existing tenants. Unless the new buyer wishes to take on the tenant, things may not flow as smoothly as a transaction without renters. In the end things tend to work out.
Sellers will almost certainly get a better price if they remove the tenants before listing and have a nice move-in ready property. Selling for $10-20k more could be worth eating a few $1500 monthly rent payments.