This phrase refers to some collaboration that occurs easily and benefits all parties.
Theidioms says the origin is unknown. The christunitedfellowship suggests Genesis 2:18-25 is the inspiration, which begins
The Lord God said, “It is not good for the man to be alone. I will make a helper suitable for him.” New International Version
Wikipedia also suggests a biblical origin, though not a citation for the specific phrase.
Jews have held an ideal standard for Jewish family life that is manifested in the term shalom bayit. Shalom bayit signifies completeness, wholeness, and fulfillment… In Jewish culture, a marriage is described as a “match made in heaven,” and is treated as a holy enterprise.
But I’m pretty sure the first use wasn’t the 1977 movie A Match Made in Heaven