What Good Are Struggles?

What good can come from struggle? Why does God allow us to go through hard things?