Google says the following.
The basic cap hit of a contract for each year it is effective is the total money a player will earn in regular salary over the life of the contract divided by the number of years it is effective. This prevents a team from paying a player different amounts each year in order to load his cap hit in years in which the team has more cap room. Teams still use this practice, however, for other reasons.
So for example for the sake of simplicity, let's say Horvat's contract pays him $40 million over 8 years. That's a 5 million per season average. The Canucks have a ton of cap space right now. They aren't going to be challenging anytime soon, so to gain cap space when they are ready to compete, they front load the first three years of his contract and pay him 10 million per. It doesn't affect them because they have lots of space that they don't intend to use. So now they can pay him 2 million per for the next five thus gaining cap space for when they're ready to compete.
Now a team can do the opposite of that. For example remember Chicago had to trade players like Ladd and Byfuglien because they needed the cap space. Now since they're lean on cap space they could pay the two players league minimum and then pump up the last years of the contract, so they'll get the same amount of money over the life time of the contract. But this in effect is circumventing the cap. This would have allowed Chicago to keep the team together for a longer period before making moves.
It allows for the a team to shift when a player's cap hit will affect the team the most. You can front pay the cap hit or back pay it.