I see characters making this motion frequently in anime. They pull one (or sometimes both) eyelid down, and stick out their tongue. What does that mean? Where does the gesture originate and what's the history behind it?
This is the Eyelid Pull Taunt
This is the act of pulling down one lower eyelid and sticking out the tongue and saying "Beh-da!" (Japanese) or "Nyaaaah!" (English dub). A highly ritualized expression of disdain or disapproval, used exclusively by children and immature adults. Basically the same as the Western act of sticking out the tongue, cranked up a few notches, though definitely not profane gesture.
In Japan this is referred to as akanbe (a corruption of akai me, "red eye"), and it's called mon oeil ("my eye") in France and Quebec. This is in fact a Franco-Japanese cultural trope, but you'll see it everywhere in anime.
I could not find a satisfying or credible enough link as to its origin(s) but from the akanbe wiki it seems to date back as far as the 20th century:
The use of the term was first mentioned by early 20th century author Katai Tayama, in his 1909 story Inaka Kyōshi (田舎教師 Rural Teacher), as a gesture used by the male students in the story.