What separates a "friendly match" from any other football match?
Usually, a friendly match means a game outside a tournament.
Like in many other sports, this kind of game is usually used as a test for both teams.
Usually, in this kind of game, although the same rule book is used, sometimes there are a relaxations in some rules, like number of substitutions. Usually, teams play in a relaxed way and the referees don´t show as many yellow and red cards as they would in normal games.
Some games, like the ones that are the last one for a player, includes several more relaxed rules, like the player playing for both teams, or an unlimited number of substitutions. The last one is usually not called a friendly match but rather a tribute match.
A "friendly" (or exhibition game) is basically the term for all games that are not competitive fixtures.
Friendlies are most common in pre-season, as sort of a training to find "the form" and raise the tempo. Also, they're often used by coaches to experiment with tactics and try out new players.
In some leagues, where there's a mid-season break, friendlies are used by most teams to get in shape for the second half of the season. They may also be played at the end of the season, if a team has a couple of weeks off before a tournament or such.
International friendlies are also played. For national teams, these are perhaps even more important than for the clubs, as they don't play the same number of matches together over the course of a season.
Friendly international matches in soccer are more than just exhibition warm ups for tournaments. They represent the coach's belief as to who are the best players the country has at the time for the position with the understanding some of the top players may not be there. Some players may not participate depending on many variables such as needing time to recover from an injury or the player's club team has a major league match coming up and they can't risk his/her sustaining an injury or being fatigued. So the motivation is pride in one's country and/or team plus showing that you are player worthy playing at the highest level.
What you're calling regular games are actually tournament or league games. Club soccer teams compete in leagues/tournament (like British Premier League, FA Cup, LaLiga and Champion's League), and national teams compete in tournament such as the world cup, UEFA Euro, or the preliminaries to advance to such competitions.
The games that the teams play to get ready for such games are called friendlies. They are meant to prepare teams for important games described above usually immediately before major competitions.
Otherwise, almost all rules apply to both types of matches. Few differences exist however. In major cups/leagues you're only allowed to have 3 substitutions, but the limit is higher for friendlies (there used to be no limit), and some other differences in regulation when it comes to having advertisement on the jerseys(at least until a couple of years ago).