The two incidents underline the insecurity and lawlessness across Afghanistan, where thousands of civilians have been killed or wounded this year amid unrelenting violence involving militant groups including Islamic State and the Taliban.