I had trouble finding background information about this strange section of border between India and Bangladesh. As you can partly tell from the lack of relationship between the rivers, the border here does not seem to be based on geographic features. As far as I can tell from the satellite images, the land here is fairly flat and mostly farm land.
Clearly, the border here is the result of some strange decision making. It is hard to know from a glance which side is India and which side is Bangledesh. My original guess was that it was part of the difficult and tumultuous partition of India into Pakistan, India and Bangladesh (formerly East Pakistan). But apparently the complexity originates much earlier when the area was under the rule of two different kings. According to Wikipedia, "The enclaves were part of the high stake card or chess games centuries ago between two regional kings, the Raja of Cooch Behar and the Maharaja of Rangpur."
The specific reasons behind the border's strange path is possible to see in the places where the border creates almost a complete loop in it's already erratic course. When I zoom in on these spots, they seem to encircle a single estate or perhaps, a small village. I'd love to know the specifics of how the border-drawing process unfolded. If anyone knows some of the specifics, please let me know.