A loop may occur in a topology with multiple switch.
Basically with 2 switches, if you connect 2 cables between those switches (without ling aggregation), then you have a loop.
With 3 switches A,B and C, and a single cable between A-B, one between A-C and one between B-C you also have a loop.
Why would we set this? To have some kind of resilience.
In practice it also happen (often) with IP phones and unaware user.
Since IP phone embed a small, 2 ports, switch, it happens that a user connect both ports to a network outlet, and without a proper network config, that can take your network down.
Now why would this cause a broadcast storm ?
Say you have 2 switches with 2 cables, connected on
Switch A port 1 - Switch B - port 7
Switch A port 2 - Switch B - port 8
When a broadcast is received by switch A on port 13, it will send it on both ports 1 and 2 (and all other ports except 13)
Switch B receive a broadcast on port 7, send it back on all other ports, so on port 8
- Switch A receive it on port 2 and send it back on port 1
.. and so on.
Same in the other way, switch B also received the first occurrence on port 8 and send it back on port 2, etc, etc...
You now have 2 packets traveling in a loop in both direction ad infinitum, since ethernet doesn't have a TTL (time to live) concept like IP.