A level-25 pokémon gets more EXP for defeating a level-30 opponent than a level-40 pokémon would get for defeating that exact same level-30 opponent. EXP in 5th-gen rewards risk more than previous versions did. In fact, 5th-gen uses a completely different formula to determine a pokémon's EXP value; even if all battlers are the same level, you'll still get a little more EXP in 5th-gen than in earlier games.