When the branch of the tree is shaken, the branch moves in a to-and-fro motion. However, the inertia of the leaves in attached to the branch resists the motion of the branch. Therefore, the leaves that are weakly attached to the branch fall off due to inertia whereas the leaves that are firmly attached to the branch remain attached.