This is just good product design and user research. Learn about the user’s goals and how committed they are to achieving them and the product with that in mind.
The intuition for why this leads to voluntary behavior is clear - if people don’t stand to benefit from a task in a way that they care about, then why bother?