A foreclosure auction buyer must evict occupants who refuse to vacate. Which post-foreclosure eviction process is applicable will depend on the type of foreclosure (trustee sale, sheriff sale, or tax foreclosure) and the type of occupants (former owner, or tenants).
Most foreclosures are conducted as a trustee sale under a deed of trust (aka mortgage). The statute that governs trustee sale foreclosures allows the foreclosure purchaser the right to obtain possession via an unlawful detainer action, which is what most people are referring to when they speak an eviction. 
The trustee sale buyer is legally entitled to possession against the former owner and other non-tenant occupants twenty days after the trustee sale. The trustee sale purchaser must give any tenant at least sixty days notice to vacate. If anyone—owner or tenant—does not vacate, the purchaser cannot just change the locks. Instead, the purchaser must go through an eviction process in court (aka unlawful detainer action).
The successful bidder at a trustee sale must serve a post-foreclosure notice to vacate. The contents of this notice are mandated by statute.
Failure to serve the post-foreclosure notice may cause a problem if the purchaser needs to evict occupants from the foreclosed property. Altough the statute arguably only requires this notice to be served on tenant-occupied property, it is a better practice to always serve this notice. Some judges will not grant the purchaser possession unless the post-foreclosure notice was served–even if the only occupants are the foreclosed former owners and relatives, and there are no tenants in the property.
Other types of foreclosure—sheriff sale or tax foreclosure—may require an ejectment action, rather than an unlawful detainer action.
If you have purchased foreclosed property you are encouraged consult with an eviction attorney.
 RCW 61.24.060.
 Puget Sound Inv. Group, Inc. v. Bridges, 92 Wn. App. 523(1998).