Luckygirl I've seen first hand the conflict experienced by second generation immigrants, although hopefully none have turned into jihadists.
Firstly, they are exposed to racism and I think we should be honest enough to admit that. They have to try hard to be one of the crowd and sometimes go overboard, especially if they get in with bullying gangs.
Secondly, their parents are caught in a trap. They want to do the best for their children, but are caught between a Western culture, which they often feel is permissive, and imposing rules, with which they themselves grew up. As a consequence, parenting can sometimes be inconsistent.
Children drift from one set of moral guidelines to another and, as with many drifters, they eventually find themselves alienated.
The Westminster Bridge murderer was a convert, but he had a classically dysfunctional childhood, along with being mixed race, which made him an outsider.
Thomas Mair, Jo Cox's murderer, also had an unsettled childhood. If I remember correctly, his mother left him with his grandmother, married and had another child who lived with her. The new husband was black. Who knows what was going on inside Thomas' head? Dylann Roof's parents were divorced and he had a difficult relationship with his stepfather.
There is a pattern in the background of Westerners who turn to extremism.