Electronic countermeasures consist of technologies and techniques used to defeat enemy sensor systems, both in combat and in other situations. They can take the form of sensor jamming, stealth systems, decoys, and cloaking devices.
Stealth is a particular type of countermeasure that keeps a vehicle from showing up on enemy sensors. The principals of stealth are to minimize reflections from active sensor systems and to minimize emissions that might be detectable to passive sensor systems.
As an example, modern stealth aircraft are made of materials that absorb the electromagnetic waves emitted by RADAR systems, reducing the amount of energy they reflect. Furthermore, the fuselage of a stealth aircraft is carefully shaped to keep whatever energy it does reflect from bouncing directly back toward its source. With its own RADAR system turned off, a stealth aircraft can have RADAR profile smaller than that of a bird.
In Star Wars
All combat craft in Star Wars are equipped with some kind of ECM system, typically sensor jamming.
At the Battle of Yavin, the Death Star's jamming was so intense that the Rebel fighters could not detect enemy fighters on electronic sensors (including electronic optical sensors) until the Imperial fighters were right on top of them. The Rebel pilots had to rely on visual sighting to find enemy fighters.
In Star Trek
In Babylon 5
The most noteworthy ECM in Babylon 5 is the stealth technology employed by the Minbari Federation. This technology makes Minbari ships essentially invisible to their enemies if they choose to be. Even when running their own active sensors, Minbari ECM technology prevents the sensors of the other Young Races from obtaining weapon locks.