The sentence has the following structure
X
Which translates literally as
I saw X and I was scared.
The X in your example sentence is what is called a noun phrase. The sentence translates as
I saw how a group of pickpockets stole money from a passenger at the sign of their boss and I was scared.