The literal translation of gaper would be yawner; the figure is always displayed with an open mouth, and sometimes you can see a pill he has taken resting on his tongue. In fact he wasn't yawning, but opening his mouth to take medicine.
The existing "gapers" in Amsterdam are almost all of Moorish appearance but this wasn't always the case and earlier ones, now in museums, show white Dutch faces as the gaper. The gaper represents the assistant of the travelling apothecary, the forefather of today's pharmacist. The apothecary would attend market days all over the country and his assistant would play the character of an ill man. After taking the pill, the assistant (often a Moor) would all of a sudden feel much better and perform a dance.
Later, when pharmacists opened shops instead of travelling through the country, the symbol of the Moorish man (often depicted with a pill on his tongue) would tell the illiterate audience that this was the home of a pharmacist.
Nowadays these symbols are rare, outside museum collections, fewer than 50 can be seen on buildings, some have now lent their names to cafes such as the Gevulde Gaper in Amsterdam.