One of the most complex borders with hundreds of enclaves and people living there with no clear idea on which country they belong to used to be the India-Bangladesh border.
https://en.wikipedia.org/wiki/India%E2%80%93Bangladesh_encla...
https://en.wikipedia.org/wiki/India%E2%80%93Bangladesh_encla...
However India-Bangladesh has enclaves of a higher nesting order.
Once Britishers came, Bengal was separated from the rest of India along their borders of their territories.