Can someone explain the BG algorythm?

I’m noticing that when I place 3rd and 4th, frequently I lose points and other times when I place 3rd and 4th I gain points.

Does anyone know the determining factor?

If you are on 4th place and depending on the rank 2-3 players including you die the same round then you get rank points from the lowest ranked player in the tavern.

Say you are 4th and you are at 4k rating and 2 more players die the same round with you, you get ranking based on 6th.

If you are 4th and just you die in that round you get whatever points your rank is currently at…If you are above 6k probably +1.

also if in a group with a friend (even in single ffa bgs, not just talking duos) the difference in ranks of the 2 of you can essentially become a high risk and little reward scenario. i play with a friend that is 1k higher then myself and in ffa matches and he dies off at say 4th, he loses points despite it being a win. if i take 1st i might win about 20 pts. however if he took 8th he might lose 100 and say i took 7th, i would lose nearly 200 because of the difference in our ranks.