It depends on the device handler. Official device handlers are created by SmartThings. Unofficial device handlers are usually created by a community developer, though I think I’ve seen some handlers that a device manufacturer created.
This FAQ post is a little old but it’s still accurate and explains how custom code works in ST (including smartapps and device handlers).