That happened to me once while my car was parked at work. I work on a farm so I always have my car in view.
I first heard a lot of noise then when I looked at my car, he was attacking it!. Claws and beak ablazing. Couldn't understand why, till it dawned on me that he could see his reflection. So funny. He even followed the car when I left for work. This went on for about a week, every day.
They are not all bird brains - I had to chuckle to myself when driving down a motorway a couple of years ago and saw a pheasant walking across a pedestrian bridge! How did it know??!!