In Pokemon Go it is very important for you to keep leveling up your trainer because the rarity and strength of the Pokemon you catch grows directly proportional to your trainer’s level.
That in turn governs how to fare against other gyms and their teams which puts trainer levels at the core of the gameplay. In order to efficiently increase the level of your trainer, you need XP, which can be achieved from a number of activities.
For instance catching a Pokemon gets you 100 XP, evolving a Pokemon get you 500 XP, hatching a Pokemon adds 200 XP, visiting a PokeStop 50 XP, while training at a friendly Gym and battling at a rival Gym both bring varying XP.
The varying gym battles based XP relies on things like how close your CP was to the opponent (the close the CP is the more the XP will be) and going by this rule, defeating a Pokemon with a higher CP than yours will get you much more XP.
That is not all, catching a new Pokemon has 500 XP as a reward, making an Excellent Throw has 100 XP reward, Great Throw has 50 XP, while Nice Throw and Curve Ball have 10 XP each.
As you can see, with a single activity you can achieve multiple of these and get much more XP.
By the way, hatching an egg to get a new Pokemon would net you 1000 XP.
Items play an important role in Pokemon Go and and even when you are targeting XP increases, they offer some help. For instance, there is the Lucky Egg item that double all XP earned in the following half an hour. Time is wisely, and / or couple it with other items like Incense or Lure Module.
You could also time Lucky Egg such that your Pokemon evolutions fall within those 30 minutes. For instance, pick up a large number of Pokemon that are easier and cheaper to evolve and evolve them in bulk and together during the time with Lucky Egg.