It's very unlikely that "smart" is involved here. I suspect the wing breaking is simply the likely end result of many possible interactions of a crab (tank with crushing claws) and a bird (lightweight and easily crushable) in a tree. Being without two useful wings is not a situation that any bird wants to be in.