OTG vs Usb extension cable?

Is there a difference in OTG and Usb extension cable? I’m trying to connect my Android phone with some IoT device and when I connect it via OTG cable it works fine, but with regular extension cable …