You've probably been told, "If someone rear ends you, it's always their fault," at one time or another. Unfortunately, this is not 100% true. While the person who rear ends you will almost always be found at least partially at fault, they are not automatically assumed to be completely at fault for the collision as many people tend to believe. Your insurance company (and if you go to court, the judge) will take several factors into consideration when determining where the fault lies.
How were the weather conditions?
If the roads were icy or there was pouring rain at the time the accident occurred, this will be taken into account when your insurance company or the court is assigning fault. First, they will consider whether the driver who hit you was taking proper precautions in regard to the current weather. Were they following so closely that they slammed into your car when they hit the brakes and their car skidded on ice? If so, they will probably be named at fault for the accident. On the other hand, if they did leave plenty of distance between their vehicle and yours, but the weather still got in the way of their best efforts to stop, they may be found only partially liable.
Second, the court or insurance company will determine whether your driving practices were suitable for the weather conditions. Did you forget to turn your lights on, making it hard for the driver to see your vehicle in the pouring rain? Maybe you stopped suddenly even though you knew it was icy out, and this contributed to the collision. If it is determined that your driving was not quite up to par considering the weather conditions, you're likely to be named partially at fault.
Were you or the other driver distracted or failing to obey the rules of the road?
If the other driver was texting, eating while driving, or engaging in some other distracting behavior that caused them to brake late and hit you, then almost certainly they will be named at fault. However, if you were engaging in a distracting behavior prior to the collision, you can expect at least part of the fault to be passed to you. For example, if you were texting and therefore did not see an obstruction in the road until the last minute, causing you to slam on your brakes instead of just steer around it, then you'll likely be partially at fault.
Was a third car involved?
Sometimes the behavior of another driver can cause you to respond in such a way that contributes to the accident. For instance, imagine the car in front of you slams on its brakes, so you slam on yours to avoid hitting them and then the car behind you rear ends you. In this case, part of the fault may lie on the driver in front of you who slammed on their brakes. Part may lie on the driver who rear ended you, as the fact that they were unable to stop in time likely means they were following too closely. You will probably be faultless in this situation.
Did one of the involved parties experience vehicular failure?
If your car malfunctions and this contributes to the accident, then you'll probably be named at least partially at fault. For instance, if your engine stalls while you're driving down the street, and someone rear ends you before you get the chance to pull over, then you'll probably be partially at fault. This is because drivers are expected to properly maintain their vehicles to avoid such incidents. On the other hand, if the other driver experiences a malfunction (such as if their brakes fail) then this contributes to their being named at fault.
As you can see, many factors are considered when determining who is at fault for a rear end collision. If you are driving along, not distracted, following all traffic rules, and you are rear ended, then yes -- the other driver is probably fully at fault. However, there are many instances in which your car malfunction or behavior may have contributed to the accident, and in that case, both parties are generally found to be partially at fault.
For help deciphering who is at fault in your car accident, it may be wise to work with an auto accident attorney so you don't get steamrolled by the other party's, or your own, insurance company.