This question has been asked plenty of times.
Here is a good reply.
Do you mean the long, continuous Ming-era Great Wall? Previous editions were not continuous, so effectiveness and its reasons would vary from dynasty to dynasty