Revealing mechanisms of mating plug function under sexual selection