What is the difference between SSR and ADS-B?
The biggest difference between SSR and ADS-B is how the aircraft position is determined. Secondary Surveillance Radar uses a radar antenna on the ground to send an interrogation signal and then determines the position based on the reply from the aircraft transponder:

The radar antenna rotates (usually at 5-12 rpm) and transmits a pulse which is received by the onboard equipment (transponder). The transponder sends back a reply containing at least a code (if operating in Mode A) but more often this is combined with level (mode C) or other information, e.g. aircraft identification, selected level, etc. (Mode S). The information received depends on the interrogation mode (A, C or S) and the transponder capability. [...]

When the reply is received, aircraft position (range and bearing) is determined. The range is calculated by knowing the time difference between the interrogation and the reply (the speed of propagation is the speed of light). The azimut is taken from the antenna position.

(SKYbrary - Secondary Surveillance Radar (SSR))
An aircraft equipped with ADS-B Out will regularly send signals without an interrogation. The aircraft position can therefore not be determined based on receiving such a signal. It must therefore be encoded in the signal itself, which requires that the aircraft knows its own position from a GNSS source:

ADS-B is a Surveillance technique that relies on aircraft or airport vehicles broadcasting their identity, position and other information derived from on board systems (GNSS etc.). This signal (ADS-B Out) can be captured for surveillance purposes on the ground (ADS-B Out) or on board other aircraft in order to facilitate airborne traffic situational awareness, spacing, separation and self-separation (ADS-B In).

(SKYbrary - Automatic Dependent Surveillance Broadcast (ADS-B))
ADS-B usually uses the same frequency of 1090 MHz to transmit, but it may also use other frequencies (see this answer for details).
Not only ADS-B signals can be received by other aircraft (ADS-B In). The ACAS (Airborne Collision Avoidance System) can also receive replies from SSR:

ACAS II is an aircraft system based on Secondary Surveillance Radar (SSR) transponder signals. ACAS II interrogates the Mode C and Mode S transponders of nearby aircraft (‘intruders’) and from the replies tracks their altitude and range and issues alerts to the pilots, as appropriate. ACAS II will not detect non-transponder-equipped aircraft and will not issue any resolution advice for traffic without altitude reporting transponder.

(SKYbrary - Airborne Collision Avoidance System (ACAS))