Promotion and Demotion
The prevailing theory behind the matchmaking system is that each player is assigned a hidden "matchmaking rating", or MMR. MMR determines who your opponents are, as well as whether you are promoted or demoted. When you win or lose a game, your actual rating is compared with the MMR of your opponent and points are awarded or deducted as necessary. MMR is only affected by the end result of a match, not the means used to achieve those results. In-game details such as APM, unit composition, and tech path of either player are irrelevant.
In order to be promoted to a higher league, your MMR must sit comfortably within the boundaries of that league, meaning you'll need to be averaging a 50% win rate against those kinds of players. If you are a 2250 MMR Platinum player who typically faces Diamond players, you will need to not only average a 50% win rate against those Diamond players, but also maintain a much higher win rate against any Platinum players you may encounter. Once your MMR reaches a certain threshold you may be eligible for promotion.
The system takes a moving average of your past X games and uses that to determine your eligibility for promotion. If the moving average crosses a certain league threshold, you can be promoted to that league.
Dropping down to a lower league works the same way, only by losing.
You do not need to reach #1 (or any particular rank) in your division to get promoted.