Pakistan has witnessed a surge in militant attacks targeting security forces in recent years, with authorities blaming the TTP and allied groups for much of the violence.