There are many ways to attach a strap to a backpack. A common way is to use a metal ring on the backpack and a D-ring on the strap. The D-ring can then be attached to the ring with a carabiner.