How Does MMR work?

i won my first 5 matches in a row and got less and less points every match

now after being queued with ppl 100 points below me vs ppl at my level 4 times in a row i now lost more than i won in the first 5 in 3 matches? i dont understand