The Encounter Bar will appear in any dungeon-roaming area, such as Blue Hamlet Trial or Stairway to Fallen Heaven, and will lose a charge every time you win a battle in the area. This can deplete from around 10 battles, give or take, in the area, and is the best way to clear the area and make it easier to explore it for any item chests that may've been left behind. The moment you've emptied the bar, you will not find it recharged until you leave the area and re-enter.