LONDON—The revelation of “Jihadi John’s” alleged links to Islamic militants in Somalia offers a window into the wave of British Muslims in the mid-2000s that turned to extremism by rallying around the black flag of al-Shabaab, the al Qaeda-linked terrorist group in Somalia.

Western officials believe “Jihadi John,” who appeared in several videos showing the beheading of hostages, is Mohammed Emwazi, a Kuwait-born British man who grew up mostly in West London.

...