Policy realms define which policies are applied to which device realms. Because you matched policy group with realm previously. It automatically refreshed and your masking policy was added to the Realm.