At the age of one, a child loves and craves for breast milk. At four, it does not have that craving. At the age of 8, a girl loves and craves for ice cream. At her 40, she may no longer have any attraction for it.
At 18, a youth could withstand pain in order to maximize his enjoyments. At 50, he may perhaps not like those pains, nor be keen to maximize the enjoyments.
At 30, a promotion in office was the best thing one may strive for. At 58, he may perhaps long for just one thing —retirement!
At 70, one may have no longing for any enjoyment, because life taught him that “joy and woe are woven fine”. If you long for pleasure, pain too comes with it as a free attachment; if you want to get freed of pain, you have to discard pleasure seeking too. Peace may be the one thing he may seek at that age.
Of course it depends on person to person as to when one realizes this truth.
For many, sex appears to be the best of all enjoyments, but those who are very watchful know for sure the pains attached to it. There are indeed many saints who had no craving for sex at all right from young age.
So, a stage of realization comes to some people at some age at some birth (after going through several births and deaths to finally grasp the hopelessness of running behind pleasure seeking and ending up with inevitable pain) . That realizaion is this: a life of perfect bliss with total absence of both pleasure and pain is the most valuable thing.
That is state of longing for moksha.
At that state, doing anything (any karma either to seek pleasure or to ward off pain) becomes unnecessary and unattractive. It is not forced on you and hence it is not slavery! You sought for it, opted for it; once you get it, you are in perfect peace with it. That is moksha for you.