When all the zebras keep together as a big group, the pattern of each zebra's stripes blends in with the stripes of the zebras around it. This is confusing to the lion, who sees a large, moving, striped mass instead of many individual zebras. The lion has trouble picking out any one zebra, and so it doesn't have a very good plan of attack. It's hard for the lion to even recognize which way each zebra is moving: Imagine the difference in pursuing one animal and charging into an amorphous blob of animals moving every which way.