The norm, as far as I know, in SHL contracts is that they have a NHL clause. The players walk if they sign with a NHL team.
It is also common to sign these youngsters for longer than probable contracts, to make sure that the players is not borrowed to another SHL (or Allsvenskan) team if the NHL team prefers further development in Sweden.
The leagues have however agreed on a (symbolic) compensation for player development - being distributed between the teams the player represented the last three years
Because the SHL falls under the IIHF umbrella, the NHL/IIHF agreement rules apply. Under that agreement, every European contract with a league under the IIHF umbrella has an automatic out clause to sign with the NHL. The player has to terminate his contract with that team prior to June 15th. This is what Jakob Forsbacka-Karlsson did in hopes of getting back to North America.
Obviously, Lysell didn't know what was going on by June 15th and couldn't terminate his contract by that date, so the Bruins had to buy out the remainder of his contract. This is what they did with Carl Soderberg back in the day. At that point, the Swedish Ice Hockey Association and USA Hockey as well as the IIHF have to sign his transfer card. If one refuses, then the IIHF makes the final decision. The SIHA can refuse to sign the agreement and then the IIHF will settle the dispute. - Again, this is what happened in the Soderberg situation.
The NHL also has a transfer agreement with the SIHA which sets the fee for transfers. I don't have the numbers under their latest agreement, but under the last agreement, NHL clubs had to pay $250,000 transfer fee for the first 10 players signed from the SHL and it goes up from there for the next 11 through 20 and so on.
European players can negotiate individual NHL clauses in their contracts which would take precedent, but any report I've seen indicates this wasn't the case here.