UI policy acts when a record is inserted or updated through a ServiceNow UI i.e ServiceNow forms while data policy acts whenever a record is inserted or updated into the database through any means.