There is a concept in Halacha called תיקון עולם, which means making the world a better place. The most famous תיקון עולם is Hillel's Prozbul that allowed lenders to collect their debt in Shmitta. Since the Sabbatical year or Shmitta, became a rabbinic law, Hillel wanted to encourage people to be able to be paid back their loans.
Another example of תיקון עולם was that people who returned lost articles did not have to make a שבועה. This meant that in case the finder was accused of not returning the entire lost object, the owner or loser of the object could not force the finder to make an oath. The תיקון עולם was that people would be encouraged to return lost articles without hassles.
The rabbis were given this power at their discretion in order to answer to the needs of society.