The Corvidae family could include some of the smartest species after primates. What could be the factors that differentiate them from other species of birds that have determined their potential for intelligence? The only explanation I found mentions their "juvenile gangs" but many other birds are more social and less intelligent.
This article posits that a lot of the reasons for primates to have evolved to be more intelligent (i.e. a costly and unpredictable environment, which requires complex thinking and problem-solving skills) could also apply to corvids. So environmental complexity might be a potential reason for these birds to have become so smart.
As far as why other birds aren't as smart, I think it's hard to say. From an anatomical stand point, smarter birds have more densely packed neurons. It's unclear based on this article why some birds would evolve more complex brains than others, but one can assume it's out of necessity based on the environment and other factors. If a species can get by with a less complex brain, it most likely will. I hope this helps somewhat.