If you are trying to get on someone’s good side with insincere behavior, your actions are “currying favor” from that person.
Curry is a horse-grooming term for cleaning and rubbing down an animal.
Within this expression, favor was originally Favel, the name of the half-man, half-horse centaur in the fourteenth-century satire Le Roman de Fauvel.
Fauvel or Favel was very evil and cunning, and it was a good idea to get on the centaur’s good side.
You could do this by pampering or grooming or “currying Flavel.”