Soccer is not like most sports in terms of the way players exchange teams. Often times in American Leagues such as the NBA or NHL players get traded for one another, however soccer is a little more complicated.
In soccer there are only two transfer windows in which players can move clubs. Transfer windows were created to maintain contractual stability for the players and clubs while still allowing players to move between clubs before their contracts run out.
The two windows where players can move clubs are:
One of two transfer windows, the other being the winter transfer window, this transfer window is traditionally when major moves are made as it gives clubs the chance to create the squad they wish to use for the upcoming season. The summer transfer window normally runs from July first to the last day in August but this year, the summer transfer window runs from May 17th to August 9th in order to accommodate the World Cup.
One of two transfer windows, the other being the summer transfer window, this transfer window usually opens on January first and closes at 11pm GMT on the last day of January. This window is mainly for smaller moves, as it is midseason, and is used to bring in one or two players who may help the club within their league.
During these windows clubs can negotiate with one another in order to improve their teams.
In simplest terms a transfer is when one club pays another club a certain amount of money to sign a player. For example Club A might pay club B 10 million dollars for the rights to a player. Once Club B accepts the transfer fee the negotiation moves between Club A and the player to work out a new contract.
If the player and club are able to agree on wages and everybody is happy, the player's registration is moved from Club B to Club A. Club A has paid the transfer fee of 10 million dollars to Club B but also is responsible for paying the player the agreed upon wages in the recently signed contract.
Players are free to move from any league to any other league and it is not limited by geography or nationality. A Spanish club in La Liga can buy a player in England's Premier League just as easily as it can buy a player from a rival Spanish team. A player does not have to be the nationality of the league where their club is located.