Swiatek beat Garcia in straight sets at the same stage in Indian Wells where the Pole's title defence ended last week in the semi-finals but faced a much more determined opponent this time around.
Swiatek powered through the first two games of the match without dropping a point and then consolidated another service break for a 4-0 lead before leaning on her serve to secure the first set in 29 minutes.
But the Pole faced much more resistance during a back-and-forth second set as she overturned a 3-1 deficit and then saved a set point while serving at 5-4 down as she closed out the match by winning the last three games.
Up next for Swiatek will be Belgian Elise Mertens, who advanced with a 6-4 6-1 win over American Peyton Stearns.
On the men's side, Australian Kyrgios, who this week earned his first win since October 2022, fell 7-6(3) 6-0 to Karen Khachanov in second round action.
Former Miami finalist Casper Ruud, the fifth seed, advanced with a 3-6 6-4 6-4 win over Serbian Miomir Kecmanovic while 14th seed Grigor Dimitrov, who lost in last year's final, moved on with a 6-1 6-4 win over Italian wild card Federico Cina.
Six-times Miami champion Novak Djokovic will launch his quest for a 100th tour-level title when he faces Rinky Hijikata while second seed Carlos Alcaraz is set to kick off the evening session against Belgian David Goffin.