Getting hit from behind by a car while riding is scary because it usually means the driver will be traveling at full speed. See video below captured from Fly 6 Camera. In these types of cases, unless there is video evidence, the drivers almost always say the bicyclist swerved in front of them.
This type of crash used to be rare before cell phones but is now disturbingly common. in Wisconsin in 2015 more than one third of all bicyclist deaths were caused by a bicyclist getting hit from behind.
Wisconsin has a law that says drivers must give at least three feet before passing a cyclist from behind but obviously when people don't pay attention to the road in front of them, the law is useless.