There are four ways that a province might change hands. Two of them are fairly clear from the start, but the other two can take you by surprise.
First up is the most common, and the situation that requires the least explanation. Your province was taken from you by force, as your enemy was able to overpower your defenders and take the territory for themselves.
Not all takeovers have to be violent. Nations may trade provinces with one another to clean up their borders, smooth over diplomatic crises, or as the terms of surrender.
Should you lose a core province (that is, one of the provinces you started with) to an enemy nation, and that province is retaken by your coalition partner, the province will be returned directly to your control.
The same applies if you retake a coalition partner's core province, so it'll be returned to your coalition partner's control.
Finally, if your province's morale drops below 33%, there's a chance it will rebel at the end of the day. When a province rebels, your garrison will either be destroyed, or will defect, and the territory will be passed to another nation. This nation can be any one of your neighbours, or a little further afield, and will not necessarily be passed to a hostile nation.