Because it is Dill's last night in town, Jem and Dill and Scout decide to go and try to look in the window of the Radley place to see if they can see anything. While they are in the act, a shadow moves and shots ring out and the kids flee in a panic. Jem's trousers get hung up and he races home without them.
When Jem and Dill have to lie in front of the adults, they face a new kind of fear about losing the trust and respect of those they love and respect. Jem and Scout also have to fear the gunshots they faced earlier when they return to get Jem's pants.
With his actions, Jem shows how important the respect of Atticus is in his life. He demonstrates this because he is willing to lie and face real danger in order to maintain his trust. As Scout points out, after this night she realizes that Jem is becoming an adult and their relationship will never be quite the same.