How does sugar syrup keep cakes moist?

How does sugar syrup keep cakes moist? I have seen a post on here about sugar syrup to keep cakes moist but I can’t find it now I need it!  Done  a search and all I get is the freezing cakes and sugar syrup….please help! 🙁