When a cardinal keeps hitting your window it simply means the bird is seeing its own reflection. Mostly birds try to scare away others so that they can easily enjoy their feasts without getting disturbed.