Answer:
Ender mends the gap between him and Bernard by finding common ground with him and helping him rise to the level of his peers. This is made possible by Alai, who serves as a bridge between them, by intervening on Ender's behalf and convincing Bernard to stop teasing him. Through Alai's help, the relationship between Ender and Bernard grows and they eventually become good friends, which changes the dynamics of the launch group and helps the others understand that they all have to work together if they want to succeed in Battle School.