"I don't want to start some type of controversy, because there's not" one, coach Larry Fedora said.
Williams, a senior who set 18 school records last season, did not play during the second half of a 41-14 victory over Delaware last week.
Trubisky took over during the final possession of the first half for the Tar Heels (3-1) and finished 17-of-20 for 312 yards with four touchdowns.
Fedora said he switched quarterbacks because he "was looking for a spark offensively" and that as Trubisky "got rolling, he got hot."
Williams was sacked for an 11-yard loss on his final play, but Fedora said the switch "had nothing to do with that sack."
Fedora said he discussed the move with Williams and "he knows why I did what I did on Saturday." The coach said he is sure Williams "knows that I have complete confidence in him."