In intelligent IoT networks, an IoT user is capable of sensing the spectrum and learning from its observation to dynamically access the wireless channels without interfering with the primary user's signal. The network, however, is potentially subject to primary user emulation and jamming attacks. In the existing works, various attacks and defense mechanisms for spectrum sharing in IoT networks have been proposed. This paper systematically conducts a targeted survey of these efforts and proposes new approaches for future studies to strengthen the communication of IoT users. Our proposed methods involve the development of intelligent IoT devices that go beyond existing solutions, enabling them not only to share the spectrum with licensed users but also to effectively thwart potential attackers. First, considering practical aspects of imperfect spectrum sensing and delay, we propose to utilize online machine learning-based approaches to design optimal spectrum sharing attack policies. We also investigate the attacker's channel observation/sensing capabilities to design an optimal attack policy using time-varying feedback graph models. Second, taking into account the IoT devices' practical characteristics of channel switching delay, we propose an online learning-based channel access policies for optimal defense by the IoT device to guarantee the maximum network capacity. We then highlight a future research direction, focusing on the defense of IoT devices against adaptive attackers. Finally, aided by concepts from intelligence and statistical factor analysis tools, we provide a workflow which can be utilized for devices' intelligence factors impact analysis on the defense performance.