The book doesn't indicate that Mr. Nathan Radley knows anything about the kids being in the garden-he fired a shot into the yard because he heard a noise, but didn't know it was them. Rather, it seems to indicate that it is Arthur Radley, or "Boo" that knows about it. After the kids sneak into the Radley yard to take a peek into the windows, the hovering shadow freaks them out and they dash out of there, going through the garden. Jem's pants get caught on the fence and come off as he struggles to escape. Later, for fear of Nathan Radley discovering the pants and telling Atticus about the event, Jem goes back to get the pants. He discovers them "folded across the fence...like they were expectin' me...and something else-...they'd been sewed up...all crooked." So his pants were mended (not very well) and waiting for him. This, based on previous descriptions of Mr. Nathan Radley as "the meanest man God ever blew breath into" and being willing to shoot anything in his yard that moved, would not be something that Nathan Radley would do. Rather, it is Boo, who has been developing an indirect friendship with the children for some time now. Gratefully, Nathan Radley knew nothing-at least that we know of-and rather it is the amiable Boo that knows about the event.
Nathan believed that someone or something was in the yard and thought it was a good idea to shoot it. However, once the children saw a shadow they grew extremely frightened and ran away. Jem's pants got caught and in order to save himself he left, but he wanted to make sure his father would not know so he went back. And when he did, his pants were waiting for him.