Answer: By being loyal to their Liege Lord
Step-by-step explanation:
Vassals in the medieval era could hold fiefs for more than one Lord. However, they always had a liege Lord whom they had an unconditional bond with and therefore owed their loyalty first and foremost to.
A Liege lord was the one to whom a vassal owed homage and to no other. If a conflict arose between one lord and his liege Lord, he would have to choose the liege lord.
It is worthy of note that by default the King was the liege lord of all vassals just like how the state is the supreme guardian of all children.