The tennis icon had a moment of reflection while riding in the back of her car, with her 18-year-old nephew driving.
"In the distance I saw [a] cop on the side of the road. I quickly checked to see if [my nephew] was obliging by the speed limit," she wrote.
But Williams, 35, then wrote she remembered the case of Philando Castile, who was shot after he was pulled over in Minnesota with his girlfriend and child in the car.
The aftermath of the Castile shooting was captured on video, with his girlfriend saying police shot him as he was putting his hands up. The officer who shot him can be heard on the video saying he told Castile "not to reach for it," referring to his licensed pistol.
"All of this went through my mind in a matter of seconds. I even regretted not driving myself," she continued. "I would never forgive myself if something happened to my nephew. He's so innocent. So were all 'the others.'"
Williams referenced other police-involved shootings and added, "not 'everyone' is bad It is just the ones that are ignorant, afraid, uneducated, and insensitive ... Why did I have to think about this in 2016?"
Williams decided to act now and in the future.
She signed the post, "I Won't Be Silent."
"As a proud American, a father who lost his own dad in a senseless act of violence, and a black man, I have been deeply troubled by the deaths of African-Americans at the hands of law enforcement and angered by the cowardly and hateful targeting and killing of police officers," he said.
"I know this country is better than that, and I can no longer stay silent," he added.