How do we get the intuition of hidden layers

How do we get the intuition that hidden layers first predict edges and then shapes and further.

They don’t, actually. That’s just said in the lectures to give you a human intuition for the process.

What a hidden layer unit learns is determined by what helps minimize the cost. They have no concept of what shapes they’re detecting.