It usually starts with usefulness, and then it progresses to friendship (or companionship if you will), and maybe more.
Take the encounter with Maevra in the swamps. Traditionally, Tomas wouldn't have any reason to keep her alive, nor did Maevra have any reason not to attack Tomas at that point. But Tomas needed information that Maevra might have, so at that stage she was more useful alive than dead, and Maevra's honour didn't allow her to slay him on the spot. Then various things, like fighting side by side happened, then talking and then they ended up being companions/lovers and then maybe something more in the end.
Then lets take the Empress, Tomas and Ayaka are tools for her to get something. Sure, she likes them both (potentially) to a point, and she will reward them as long as they remain useful, but she won't hesitate to get rid of either if they become a threat to the Empire, or stop being useful. But that isn't out of maliciousness, but out of duty to the Empire and its people. Which makes her (and the Emperor) good leaders; they are there to take care of the people, and in doing so, the people take care of them. For the most part, there are always those who have greater ambitions.
Ultimately, it's the same with Malgrin and Tomas. The initial encounter all those years ago was Malgrin trying do a good thing so he could "redeem himself to himself" basically. Saving Tomas and Iraea was a means to that goal, to justify his existence, then it grew into something else over the time, friendship between himself and Tomas.
Now, the "master races" and whatnot are useful traits for those whom the heroes oppose, or as a "personality trait" that you grow out of as a character, if kind of story.