Like an algorithm designed to access an adversary’s digital network, the Islamic State’s carefully staged videos, featuring the beheadings of American and British journalists and aid workers, have penetrated the Western psyche.