Nonassociative learning is a basic neuroadaptive behavior exhibited across animal phyla and sensory modalities but its role in brain intelligence is unclear. Current literature on habituation and sensitization, the classic "dual process" of nonassociative learning, gives highly incongruous accounts between varying experimental paradigms. Here we propose a general theory of nonassociative learning featuring four base modes: habituation/primary sensitization in primary stimulus-response pathways, and desensitization/secondary sensitization in secondary stimulus-response pathways. Primary and secondary modes of nonassociative learning are distinguished by corresponding activity-dependent recall, or nonassociative gating, of neurotransmission memory. From the perspective of brain computation, nonassociative learning is a form of integral-differential calculus whereas nonassociative gating is a form of Boolean logic operator – both dynamically transforming the stimulus-response relationship. From the perspective of sensory integration, nonassociative gating provides temporal filtering whereas nonassociative learning affords low-pass, high-pass or band-pass/band-stop frequency filtering – effectively creating an intelligent sensory firewall that screens all stimuli for attention and resultant internal model adaptation and reaction. This unified framework ties together many salient characteristics of nonassociative learning and nonassociative gating and suggests a common kernel that correlates with a wide variety of sensorimotor integration behaviors such as central resetting and self-organization of sensory inputs, fail-safe sensorimotor compensation, integral-differential and gated modulation of sensorimotor feedbacks, alarm reaction, novelty detection and selective attention, as well as a variety of mental and neurological disorders such as sensorimotor instability, attention deficit hyperactivity, sensory defensiveness, autism, nonassociative fear and anxiety, schizophrenia, addiction and craving, pain sensitization and phantom sensations, etc.