I've been cycling in urban environments for 20+ years, and the only time I've been hit by a car was when I was rear ended at a stop sign. There's also been a half dozen or so other times where I've heard cars come to a quick stop behind me, or that I've pulled into the crosswalk to avoid being hit.
I was literally "rear-ended" by an 18 wheeler at an intersection in downtown Chicago. Orleans and Grand iirc.
The guy had pulled up so close to my back wheel, and then "forgot" I was there. When the green turned, he immediately impacted my back wheel.
I was able to exit the bike in the brief second between that tap and when he seriously hit the gas. My bike proceeded to be crushed by the semi along with all my electronics in my bag strapped to the back. I was so lucky to get off the bike (admittedly I was incensed that someone had bumped me and I was about to get into a fight with the person), if I had tried to stay on that bike I would've definitely died!
Being rear-ended is one of the most common accidents for cyclists and motorcycles. When I rode in California, it was less of an issue because I was between cars side to side, not front to back. I felt much safer there than I do in Iowa where I'm forced to queue behind cars and hope the people behind me see me and stop for me. That combined with the much shortened riding season means drivers also aren't as aware of motorcycles and cyclists as they are in areas where people ride year round. I literally rode everywhere in SoCal. It was my primary means of transportation. I ended up getting rid of my motorcycle not long after I moved back to Iowa because of those safety reasons.
The only other time I really got hurt was when a very aggressive driver (again downtown chicago)( became incensed that I was riding in the car lane (no bike lane) and got within inches of my back wheel and started honking like crazy, scaring the shit out of me and causing me to slam into the curb and fly off my bike.
Both were accidents I made while a newb biker, I became a lot more "seasoned" after these two events and became a way more defensive biker