But you can't really blame people. They don't see the effort going on and don't know of the sacrifices made to get there. It is human nature to attribute essentially "luck" to the good we see in the lives of others. Take even seeing someone who is very skilled at something, be it anything from athletics to instruments. We hear someone playing piano flawlessly and marvel at how talented they are. Do we ever pause to think about how much work went into developing that talent?
When I was in high school, I was at a church leader's house. Her daughter-in-law was furiously playing their grand piano in the other room. My leader explained her daughter-in-law was working on a master's degree of some sort in piano--it was a long time ago; I can't remember what she was officially working toward. What I do remember is that she was required to practice 10 hours a DAY. A day! Yet we would hear that playing and think, "Wow! She is talented!" and probably wish we had been given that talent. I know some people have talents that just come naturally, but most things we see as talents in others are the result of effort on their part.
So I cut people slack. They don't know how much time and effort I have put in. And those "lucky" babies do come. People do get lucky babies who just sleep well. So the comments come. They tend to come with less frequency with each child you have who is a good sleeper. People recognize "luck" doesn't happen that often.
When the comments come, you have a handful of options for your reaction. If you don't know the person well, saying a simple, "Thanks!" or "Yeah." can suffice. If you are visiting with the person, you can throw out there, "Oh luck had nothing to do with it! We [insert brief details here]." Sometimes the comments come simply because they are making conversation.
Just remember the comment isn't intended to be a jab at you or an effort to undermine anything you have done. Those people are out there, but most make comments innocently. Respond in kind.