Some say that the purpose of a graduate education in the sciences is to learn how to learn. Primarily through hands-on experience, with your advisor's coaching, a graduate student learns what questions are worth asking, what qualifies as a believable demonstration of an idea, and what level of perseverence is required enroute to a publishable result. At the end, the student has learned how to work as a scientist. While this may be true, there is more. It's only once you've become a graduate student that you learn enough to know that you don't know anything.
Graduate school teaches perspective, a sense of the limits of what one knows.
Sometimes this comes through frustration, when months fly by with cells repeatedly dying, or computer programs repeatedly going unstable. Sometimes this comes through the surprise at how ad hoc and incomplete our current understanding the creation is. Fundamentally, it is knowledge that provides the food on which perspective grows. There is, however, another level in which we cannot have a healthy sense of limits without a robust base of knowledge. Feelings of humiliation, frustration, and surprise may help control tendencies towards pridefulness, but the feelings themselves will not produce perspective without knowledge, for a recognition of the limits of what you know requires learning both what is inside, as well as outside, the limits.