Common use-cases we've seen for self-contained animations are:
Loading animations — keep users engaged and delighted to show that an app is "alive" rather than hanged during load-time. Ex: Airbnb's loading spinner.
Welcome tours — first-touch experience is so critical to user activation (in the product-marketing sense of the term), the more delight and polish you can pack into the NUX, the better.
Doodles, polish, character — in the same way that illustrations-as-embellishment are in the design zeitgeist (see designbetter.co or gusto.com); self-contained animations are an excellent way to bring artistic character to your software, as a way to differentiate your brand & instill delight.