The story
* co- + -in-law The usage comes from the reciprocal relationship of the two people separating the people in question, such as two men who are each father-in-law to one of the parents of their grandchildren.
Etymology from Wiktionary, CC BY-SA 4.0.