Loyalty between kings and their warriors is something carried over from the Anglo-Saxon and Medieval eras. The king pledged to take care of the warriors and their families in return for the warrior's pledge to protect and fight to the death if necessary for the king.
In Macbeth, we see this from the very beginning with Duncan checking on his warriors (Macbeth and Banquo among others) against the traitor MacDonwald. The play begins and ends with a battle and a speech. After the war, Duncan addresses the people and rewards his loyal thanes with titles, land, jewels, recognitions, and publie praise. The same is true with Malcolm after the traitor Macbeth has been overthrown and his head is on a stake.
In addition to these examples, you have Macduff's examples of loyalty to Malcolm by not going to Macbeth's coronation or his first banquet as King.
Lady Macbeth shows loyalty to her father by not killing Duncan since Duncan resembled her dad. She is also fiercely loyal to Macbeth even though he basically "dumps" her and leaves her on her own after their murder of the king.
Macbeth's household members and warriors and loyal to him through fear only. Many of them flee the house and the battlefield to ally themselves with the opposing forces to escape his nightmarish rule.
An unknown servent is loyal to Lady Macduff and risks his life to warn her that hers is in danger.
Malcolm's warriors know they are aligned with "good".