suggests that
enjoying a benefit sometimes requires tolerating the inconveniences that accompany it.
The saying “He that would have eggs must endure the cackling of hens” can be used when in order to enjoy one thing, you might have to endure the annoying or unpleasant things that accompany it.