In RPGs, experience is gained in 3 ways, which overlap as the game progresses.
1st way - the GameMaster grants you experience points for completing a quest.
2nd way - you receive experience points for picking locks and for defusing (not destroying) mines of various difficulty levels.
3rd way - for destroying enemies.
The 3rd way should be examined in more detail!
Enemies in RPGs have their own development level, and the amount of experience you receive for killing them depends on this level. If the enemy's level is higher than or equal to yours, you receive N amount of experience points, initially assigned to that enemy. If the enemy's level was lower than yours, the amount of experience you will receive will be equal to N - 50*the difference in levels between the enemy and your character. The amount of experience for killing an enemy cannot be lower than 25 points.