Radar is the main way to gather intel on your opponent without seeing his units. It will not identify units if you cannot see them, however it will show you where they are. It can also distinguish between air, land and sea units (triangles for air, squares for land and buildings and the top half of a circle for naval) though it cannot detect submerged subs. If a unit has been identified via a visual sighting, then as long as it does not leave radar range you will still be able to see what the unit is, even if it can no longer be seen by your units. They will then be marked by the appropriate marker (circles for experimentals, trapeziums for gunships, shorter triangles for bombers ect). Sonar is the same as radar except it can only see naval units (including subs).
The UEF get a seperate radar and sonar station and neither get any upgrades. The Cybrans have a combined radar and sonar station making it quite versatile, and it can be upgraded to have a 50% longer radar range and a 200% longer sonar range. The Illuminate only get a radar station, but research can unlock the manually activated overcharge ability, which for a small energy cost can massively increase the radar and visual range of the structure.