When is it appropriate to use a dedicated charging ic and when is it appropriate to use a microcontroller?
So in short, what is the logic when deciding to use a dedicated
charging chip? Obviously the behavior is well defined and it saves
many hours of engineering, but for mass produced devices, it seems
as if that would not be an issue.

Of course it is an issue. Behavior that is not well defined leads to an unreliable product, which is generally more of an issue for mass produced devices. Engineering cost becomes less important as quantity increases, but still has to be incorporated into the price. Mass produced products are usually more cost-sensitive than 'custom' designs for small markets, and the consequences of a design error may be worse.
In practice, dedicated charger ICs are typically used in low cost devices that don't need a sophisticated charger. They are usually hard-wired to match a particular battery, and have just enough 'smarts' to charge that battery safely and provide the user with basic status information. Examples of this include devices using the TP4056, and 'chargers' that are really just a current limited power supply.
An MCU is appropriate for more expensive devices that need more sophisticated battery management (eg. cell phones, laptop computers), higher voltage and power with greater safety and efficiency (electric cars etc.) or for general purpose chargers which work with a variety of different batteries. It may be combined with a programmable charge controller IC, or with discrete transistors and general purpose ICs.
An MCU may also be used when a dedicated IC for the particular battery type is not available or is more expensive (eg. Nicad and NIMH chargers).
Ultimately it comes down to balancing the cost and convenience of a dedicated IC against the greater flexibility of an MCU based design. Designing a small single cell Li-ion charger using an MCU takes a lot more skill and effort than just throwing a TP4056 at it, but makes sense when the battery is larger, has more cells, or needs better battery management and user feedback. In many cases trying to use a dedicated IC may end op being more difficult and expensive, either due to the extra circuitry required or because it doesn't work reliably.