Thermodynamical aspects of gravity: from event horizon to emergent gravity