To control events like NPCs, chests, etc, you use variable or switches. They're numerical values that control all actions inside the game. Like: you haven't got the pass from the mayor to exit the city? You already got the treasure from a chest? Those are all numbers, inside the game.
Switches are like variables, only that it's only has two values: 1 or 0 (on/off). You control simple events with it, like chests. Switches are just a simple alternative to variables. Switches are used normally for simple chests: condition for being active? Switch A must be Off (the starting position off a switch), then, inside the chest event, you add:"Turn Self-switch A: On" after giving the character whatever was inside. Next time you return to that particular map, the chest won't be there.
The 'appearing' conditions of all events are checked every time a map is loaded.
WARNING: self-switches of events CAN'T be changed or measured by other events.
For that you must use global switches- they can be changed by remote events.