I Think It Depends on What You Are Hiding, and Why
The Treasure and Trap May Be Interacted With Daily
In King Solomon's Mines there were the eponymous diamonds mines of King Solomon.
Mine managers needed a place to store raw diamonds pulled from the earth between caravans hauling the goods back home, which (since the mines were remote) could be months, or even years.
The trap was deadly, but something the managers could interact with every day w/ minimal risk: a extremely heavy secret door led down a long hallway that ended in the diamond store room. Only the managers (of which there were only a few) knew of the door or how to open it.
The door was on a timer, and would close a few minutes after opening.
The trap in King Solomon's Mines was deadly, but not instantly so (you died of starvation, or suffocation). Managers using the store room didn't need to remember what the trap was. They need remember only the far more general rule : the store room is trapped; do your business quickly and get out. Also, in the event a manager was trapped inside, one of his/her peers on the outside could notice their colleague was overdue, and open the mines themselves.
Additionally, as the heroes figure out to their salvation, the engineers who were building and testing this trap didn't want to get locked in for every successful test. They built a back door to the storehouse, that the heroes intuited must exist and which, with a little searching, they found.
The Treasure Might Be Yourself
In the Curse of World War II Gold, members of the Japanese military were trapped by an invading army inside a network of tunnels in a foreign land. The imperial army had been looting riches from the government and people of all nearby islands and, since the regional command was stationed here, concentrated with this Imperial force.
Trapped in the mountains, most of the deadly traps laid : land mines, poison gas, pits, cave-ins was meant to protect the army from the enemy.
Meanwhile, the general ordered the digging of deep pits, around 200 feet deep). These pits weren't trapped. They were even marked in layers of material not native to the island as the pits were being filled-in, so that people retrieving the treasure could know they were digging in the right spot.
The pits require an enormous amount of labor to unearth, so this effectively protects the treasure against random soldiers fighting back-and-forth for control of the territory. Someone must possess a stable hold on the land, and the ability to put a sizeable workforce together (hopefully the victorious Japanese Empire) in order to recover the goods.
Because the soldiers were trapped in the mountains, the untrapped treasure pits were in the midst of trapped tunnels.
Or, You May Only Plan on Coming Back for the Treasure Once
In Goonies the crew of One-Eyed Willy found themselves running from the British inside a coastal cave. The entrance to the cave had been collapsed by British cannon fire, and One-Eyed Willy's ship and crew had been sealed alive.
One-Eyed Willy's engineers manage to dig their way out of the cave. The captain and crew has a dilemma: they are far behind enemy lines; it will take them months, maybe even years to - get home, recruit a new crew, and get ships back to this spot.
In this case Willy orders the construction of traps that, hopefully, they will only need to evade and disarm once. They plan to come back and empty the treasure cave, never to return.
In this case, deadly traps keep the locals from working together to get at the treasure cave. Anyone accidentally finding the cave and traps is, hopefully, silenced immediately.
Unfortunately, Willy decides to poison his crew at the last celebration before they depart for the wilderness. And the crew decides to poison the captain as well.
Meant to Stay for Generations
In The Curse of Oak Island a treasure was buried in a 200 foot deep pit, protected from outsides by a network of trap tunnels that would allow the seawater into whatever workings you dug, spoiling the pit. The traps weren't necessarily lethal, but easily could be.
In this case, probably, the treasure was meant to stay put. Possibly indefinitely.
Many of the theories involve that communications about the treasure include principals for disarming the traps (such as the location and existence of the traps intakes of ocean water).
Similarly, in Aladdin, the entire Cave of Wonders is filled with poisonous treasures. The treasure is the trap. Only someone who knew what the real treasure of the Cave of Wonders is, the genie lamp, would be able to retrieve it. The lamp could be hidden that way for generations, as the way of defusing the trap is a very simple rule : only touch the lamp.
This way, whoever built the Cave of Wonders kept the extremely powerful genie lamp within reach (should a national emergency occur), and could pass the secret to getting the lamp to his/her descendants; but at the same time, the extremely dangerous lamp was kept out of reach day-to-day.
Never Meant to Be Found
In Temple of Elemental Evil a deity of fungus oversteps it's bounds and becomes imprisoned at a location on Oerth. To keep anyone from ever releasing the fungus deity, layers of very deadly traps were constructed.
In this case, the traps are never meant to be circumvented. The goal is to keep everyone out of the god's cage forever (or at least a very long time).