Some birds, like the cardinal, will try to fight their own reflections in the window, and will keep going until they die. If you have curtains or a light-colored shade you can draw behind the glass, you can close them and the striking should stop. Otherwise it's probably what Tdyer said; it thinks the glass isn't there and it can fly into your house.
The bird wants in that area and can,t see the window.
That you must keep your windows clean or he's drunk!
A bird will try to fly into a closed window simply because they do not see the glass.