Bruno changes his perspective about friendship because of his interactions with Shmuel. He learns the meaning of loyalty, sacrifice, and courage.
When Gretel (his sister) demands information about his friend, Bruno pretends that Shmuel resides in his imagination. As Gretel taunts him for having an "imaginary friend," Bruno decides that he will tell her about Shmuel. He isn't worried about exposing his secret friendship with Shmuel because he has already convinced Gretel that Shmuel is imaginary.
As Bruno tells Gretel about Shmuel, we can see how Bruno has changed. He is no longer the peevish boy who complained bitterly about leaving Berlin and his best friends (Karl, Daniel, and Martin) behind. Now, he is Shmuel's friend, and he shows obvious concern for Shmuel's welfare. During his conversation with Gretel, Bruno quietly relates Shmuel's grief at discovering that his grandfather is missing.
He recounts how sad Shmuel was when the latter told him the story of his missing grandfather. After Bruno finishes speaking, he suddenly realizes that he neglected to comfort Shmuel or to offer him words of encouragement. Bruno is horrified at his seeming insensibility to Shmuel's emotional anguish, and he privately berates himself. He decides to apologize to Shmuel for his insensitivity the next day.
Bruno's behavior shows that his interactions with Shmuel have changed him. He has become more sympathetic in nature and is less absorbed with his private grievances. Before he returns to Berlin, Bruno offers to help look for Shmuel's father (who is now missing).
At the camp, Bruno is devastated by what he sees: soldiers in uniform mistreating unhappy, crying prisoners in "striped pajamas." The scene destroys his previously composed mood, and he tells Shmuel that he wants to leave. However, Shmuel reminds Bruno of his promise to help look for his father. In the end, Bruno stays. He keeps his promise, despite his fear.
Presumably, the boys die after a group of soldiers corral them into a gas chamber. Bruno's last words testify to how he has changed. Even though he senses that something is wrong, his focus is on comforting Shmuel. No matter what happens, Bruno insists that he will be by Shmuel's side.
'...when you come to Berlin, that's what we'll do. And I'll introduce you to ... Oh, what were their names again?' he asked himself, frustrated because they were supposed to be his three best friends for life but they had all vanished from his memory now...'Actually,' he said, looking down at Shmuel, 'it doesn't matter whether I do or don't. They're not my best friends any more anyway.' He looked down and did something quite out of character for him: he took hold of Shmuel's tiny hand in his and squeezed it tightly. 'You're my best friend, Shmuel,' he said. 'My best friend for life.'