The Hebrew verb khabal translated as in labor
can also mean conceived you.
The parallelism of Hebrew poetry normally intensifies the thought of the first line which suggests a progression in this verse from arousal (first line) to conception (second line) to birth (third line).1
The double reference to the apple tree as the place where his mother was in labour with him is a metaphor linking what the apple tree represents (sexual intimacy) with the joyful/painful results of that act in terms of offspring. The pleasure of sexual intimacy is set in the context of extended family, in which generation after generation safeguards the family and its continuity.
The goal of sexual arousal in marriage is not merely the human pleasure that the Song has celebrated, but it also hopes and longs for the joyous outcome of pregnancy and childbirth, even with all of the pains and challenges that parenting brings.2
5 Who is that coming up from the wilderness, leaning on her beloved? Under the apple tree I awakened you. There your mother was in labor with you; there she who bore you was in labor.