This quote means that sometimes it is difficult to appreciate beauty and good things in life until you experience difficulty or hardship. The darkness symbolizes these difficulties or hardships, and the stars symbolize beauty and good things. So, it is only when you experience darkness that you can truly appreciate the stars.