Thank goodness you're a careful driver
I don't know much about driving but it sounds like you were the proper distance and that allowed you to react, the guy behind you probably wasn't as far back as he should have been.
And my friend got rear ended by a drunken driver in broad daylight, her back was messed up for nearly a year, and she still have problems with it occasionally.