Conditioning

There are two different types of conditioning: classical and operant:

In classical conditioning, two (initially independent) stimuli are linked together. For example, if you have experienced a panic attack on a bus, the two stimuli (bus & panic) can become associated, and riding the bus (which in itself is not dangerous) can trigger panic.

Operant conditioning can occur when a behavior is followed by a certain consequence. For instance, if you start avoiding bus rides and as a consequence no longer experience panic attacks. Unfortunately, this maintains the fear because you don't experience the corrective consequence that nothing bad happens when you ride the bus.