The historical covenant and the severe warning against idolatry stand at the center of God's command. The establishment of this covenant refers directly to the giving of the Torah at Mount Sinai. During that event, God commanded the descendants of Jacob and strictly warned them against engaging in idol worship [רש״י, מצודת דוד].
The specific focus of this warning can be understood from two distinct perspectives. One approach views the mention of the covenant as a way to highlight the sharp contrast between the pagan practices of the Cutheans who were brought to Samaria and the exclusive commitment demanded of the Israelites [ביאור שטיינזלץ]. Alternatively, the warning serves as a direct rebuke to the foreign nations who settled in Samaria and underwent conversion. Because they converted, they were fully exposed to the Torah's warnings and were well aware of them. Therefore, from the moment of their conversion onward, they were obligated to strictly avoid any form of foreign worship [מצודת דוד].
The command itself is laid out with precise detail. It begins with the instruction not to fear other gods, serving as the first in a series of warnings. These instructions are carefully designed to completely separate the people from any contact, active worship, or even fear of foreign deities [מלבי״ם].