for total system of bird and cage the external forces are only gravity and spring balance force so if the bird flies gravity on the system won't change so the spring balance force also won't change as both cancel each other in two cases hence W1 must be equql to W2 i.e center of mass of bird and cage remains at rest in both cases hence W1 is equal to W2