It was Williams' fourth match back in the WTA after returning at the 2018 BNP Paribas Open following the birth of her daughter last September.
Osaka, meanwhile, is looking to win her second tournament in a row after she triumphed at Indian Wells, beating Daria Kasatkina in the final.
During her title run in Indian Wells, California, Osaka deployed a wide variety of effective groundstrokes that caused problems for her opponents. In that sense, the 20-year-old was probably the worst possible opponent for Williams.
Williams is still playing herself back into tournament shape in what's only her second event, so she's not quite as sharp as she'd normally be. In addition, Williams' power isn't all the way there, either, which left her unable to regularly put Osaka on the defensive and neutralize her baseline game.
The 36-year-old's rust was evident in the first set, when she committed 14 unforced errors. She didn't help herself, either, by getting fewer than half of her first serves in (48 percent), according to the tournament's official website.
That allowed Osaka to capitalize on Williams' second serve and put the 23-time Grand Slam champion on the back foot.
Osaka was also a model of consistency. She finished with fewer winners (seven) in the first set than Williams (10) despite winning five more points points over the course of the opening frame. Osaka was aggressive but in such a way so as not to overhit the ball or try to do too much with a difficult angle.
ESPN's Brad Gilbert praised that aspect of Osaka's game:
WTA Insider shared a clip from a point in the first set that illustrated how well Osaka operated from the baseline. She matched Williams shot for shot until she saw an opening to put Williams away:
The second set was more of the same. Williams won just two of her 11 second-service points and allowed Osaka to have five break-point opportunities. Her number of unforced errors were identical as well, as she committed 14 over the final eight games.
Osaka had 12 unforced errors for the entire match. Williams simply had no answer for the smooth-hitting Osaka.
After the match, Osaka discussed how defeating Serena was special because she had grown up as a fan of hers. WTA Insider shared her post-match interview:
Osaka will face off with fourth-seeded Elina Svitolina in the next round. Svitolina won their previous match this year at the Dubai Duty Free Tennis Championships in February, but they've split their four meetings overall.
An Osaka win would represent an upset in terms of the tournament seeding, but nobody would be too surprised if she prevailed based on the way she's playing at the moment.
For Williams, Wednesday's loss is another stumbling block in her comeback. Some bumps in the road were to be expected after she was away from the game for over a year. She still has more than two months to get herself ready for the 2018 French Open, which starts May 27 in Paris.