In electrical and mechanical trades and manufacturing, each half of a pair of mating connectors or fasteners is conventionally assigned the designation male or female...
The assignment is a direct analogy with genitalia and heterosexual sex... Extension of the analogy results in the verb to mate being used to describe the process of connecting two corresponding parts together.