This is what I think happened.
Do you remember when Dumbledore had a fight with Snape about the thing that he had to do and he couldn't get out of it? WELLLLLLL.... what if the thing he had to do was to kill Dumbledore. Think of it this way, at the end of the book, it said Dumbledore was pleading. I think that D was scared that Snape would back out, so Snape very reluctantly killed him. Therefore, letting Voldemort believe that he was still on their side. That's just my theory! Tell me wat ya think!!
😛