A list with multiple selections example explanation

Hi,
I have been trying for days now to do a basic filter on a selected items on a list, today lucky i have found the solution by @NigelG ( thank you very much by the way ) it is exactly what i was looking for, i copied it and it is working fine for my list.

https://buildingonbubble.com/block/a-list-with-multiple-selections-1472220949220x795693731957964800

But the problem is i have no idea what is going on, spent hours and hours with pen and paper and all trying to get the logic behind this but still lost, the reason i need and explanation because i think it would really help me to understand how to do logic within bubble. ( or maybe i’m not the smartest guy in the world today?? :frowning: )

I come from coding background, and coping and pasting without understand will only get you so far.
If anyone understands this please share any knowledge you have

Thanks