Why does it command to fear Hashem and the king?
Rashi: Fear the king, as long as he does not veer you from Yir'as Hashem. Yir'as Hashem comes first.
Malbim: Fear Hashem in matters of creed, and the king, who establishes the land with Mishpat and conduct of society.
Who are "Shonim", with whom one should not mingle?
Sotah 22a: They are those who recite Mishnayos [but did not learn the reasons and resolutions of the Mishnayos; they are ignoramuses].
Rashi: It is those who say that there are two powers.
Malbim: It is those who want to change the conduct of society - to rebel against the king and establish a new conduct unlike the old. This annuls also Yir'as Hashem, for He commanded that fear of the king be on you!