Along with locking Pokemon into subpar moves or nondamaging moves, like setup moves, Encore also has the effect of helping one's own setup.
The best example of this is Iron Valiant, which can be extremely dangerous with it's Swords Dance set. However, it can struggle to find opportunities to Swords Dance due to it's mediocre bulk. As a result, Encore can be used to lock certain Pokemon into nondamaging moves so Iron Valiant can spam Swords Dance. Take Ferrothorn, and as Iron Valiant switches in, it sets up Stealth Rocks. Iron Valiant can then proceed to Encore the Ferrothorn and get a free Swords Dance, unafraid of Gyro Ball.
It is worth mentioning that Encore can also be used to generate free opportunities for the user's teammates, not just itself; after using Encore, the user can switch out to another Pokemon that benefits more from the free turns.