Officials are still investigating that assault, which was claimed by Islamic State, but the two attacks underline the broad security threat in Afghanistan, where the Taliban have stepped up their insurgency against the Western-backed government.