Classic behavioral conditioning: Bird flies into window, might have bruised it's ego; hangs out a bit and gets fed by the sympathetic human; rinse, repeat. It's found a great way to get fed with little work involved but to hit the window, feign injury, and decorate the hood.