ghost marriage is also called yin marriage. In feudal times, yin marriage is when a male of a certain family dies without any marriage relationship. His parents find a witch (referring to the matchmaker who is engaged in yin marriage) and beg the witch to introduce a "female ghost" to the deceased man (referring to a woman who has no marriage relationship, she is also a dead woman). The witch asks the male parents for birthdates, and then goes to the family of a woman who corresponds to birthdates after finding the "female ghost". Then both parents meet and agree that the man and the woman can be buried together.
This kind of thing belongs to superstition. It exists in economically underdeveloped places in central and western China.