Binary Indexed Trees: Why does i & -i work?
Assuming that your tree is storing cumulative sums, one query you would like to make is "what is the cumulative sum to index n".  Suppose the tree is as shown in the OP, and n is 5.  The answer to the question would be found by adding the sum in node 4 and the sum in node 5.  This is because each node is storing the cumulative sum of itself plus its left subtree (if any).  Thus, node 4 has the cumulative sum of indices 1-4 and node 5 has the cumulative sum of index 5 (just itself).  Because of the way the tree is built, you basically need to visit one node for each 1 bit in the binary representation of your index.

So the algorithm to compute the cumulative sum is to start at the given index, in this case 5.  Note that 5 is 101 in binary.  Add its sum to the total.  Then, to get to the next node needed, we want to remove the least significant bit (we want to get from 101 to 100).  The least significant bit of i is i &amp; -i.  To remove the least significant bit, i -= (i &amp; -i).  That gets us to node 4.  We add node 4's sum to the total.  Then we remove the next significant bit, leaving 0 which means we are at the end.

If the tree were bigger, and the starting index were 50 (which is 110010 in binary), we'd have to visit node 50 (110010), node 48 (110000), and node 32 (100000).  In this example, node 32 contains the sums of 1-32, node 48 has the sums of 33-48, and node 50 has the sums of 49-50.