Well, all the food is "down there." So is the nest, which is built in one place from material gathered in quite another place. A good deal of their business is conducted where they're out of their element. Get down there, do what you gotta do, but do it smartly and get back upstairs asap.
Then there's the migration thing.
And birds in the wetlands have it even more complex.
If they weren't exceptionally intelligent they'd be gone with the rest of the dinosaur tribes.
Still no need to be smarter than apes. Still can survive sufficiently with physical advantages and the brains to use them.
Food - no need to have ape-like intelligence to grasp food with claws, fly up with it, peck it open with a hard beak. Or fly to food that’s still in a tree, which is even better (it’s in that niche I was talking about).
It doesn’t take ape-like intelligence to build a nest.
It doesn’t take ape-like intelligence to migrate. If anything, the wings are the big advantage there, not brains. Instinct is not thought or reasoning.
You don’t need ape-like intelligence to survive in wetlands. Flying is a great advantage in those areas, just like it is on dry land.