They've made it really clear a lot of times.
You gain MMR by winning a game.
You lose MMR by losing a game.
If your personal MMR is higher than the average MMR of the 10 players in the game, you will win less MMR/lose more MMR.
If your personal MMR is lower than the average MMR of the 10 players in the game, you will win more MMR/lose less MMR.
Matchmaking starts by looking for players very close in MMR, but as the queue goes longer and longer, the boundaries the "acceptable" MMR widen.
The amount of LP you gain/lose is based on your personal MMR compared to the average MMR of the people of your rating.
For example, if you are at Plat 3 30 LP, and your MMR is higher than other Plat 3 30 LP players, then you will gain more LP for a win (lose less LP for a loss), and vice versa.
Your rating at the end of the game (A, S, S-, etc.) is based on your performance on that champion in that particular lane (taking into account farm, kda, kill participation, damage dealt, etc.) Farm is by far the most important factor for non supports.
Hope I helped.