Williams lost her round of 128 match to Qiang Wang of China in two sets, falling 6-4, 7-5 Sunday on Court Suzanne Lenglen in Paris. Williams is ranked No. 9 in the world, while Wang is ranked No. 85 by the Women's Tennis Association.
"I think she just played well," Williams told reporters. "All of the times that we've played, she has played great. I think her game just got better and better during the match."
Djokovic -- who last won the Grand Slam in 2016 -- beat Brazilian Rogerio Dutra Silva 6-3, 6-4, 6-4 on Monday to advance into the round of 64. He will face Spain's Jaume Munar in his second round match at 5 a.m. EDT Wednesday at Roland-Garros.
Djokovic is playing in his second consecutive Grand Slam. He spent six months nursing an elbow injury.
"It has been difficult to face injury," Djokovic said. It was "the most challenging injury that I ever had. It has been a long 12 months behind me but I'm starting to play better I feel like in the last couple weeks. Not thinking about the elbow and playing pain free, which is the most important thing at the moment."
Wang faces Petra Martic in the round of 64 at 5 a.m. EDT on Wednesday.
Sunday's exit marked the first time in Williams' career that she has been knocked out of back-to-back Grand Slams in the first round.