When Princess Anne was born, her mother was not Queen, but heir apparent. Thus Elizabeth was first in line to the throne, Charles as her first born was second, and Anne at the time of her birth was third.
As a female, Anne was always going to be at the bottom of the list. That is what the male preference means. Any males come before any females. So of Queen Elizabeth's children, Charles is first as the first born son, then Andrew as the next eldest, the Edward then Anne, despite when they were born. The age criteria only comes into play when they're the same sex. Hence why Charles is ahead of Andrew.
In terms of the line of succession, children follow their fathers. So any child of Charles comes after Charles. Same for Andrew, and Edward, and if any of those children (lets say William) has children they come directly after their dad also. (Prince George has pushed Harry, and everyone else down one slot as he follows his dad).
The eldest son is, in essence the most important, and he passes everything on to his eldest son, and so on.
The new law wasn't down to the Queen. She does not change laws, she might have suggested it, but in all likelihood, it was the government and the Queen. I don't see the point about William being a favourite as being a reason for this, any child Will has will follow him.
The issue has never really need to be addressed before, as both the Queen and Diana had boy's first. I don't know if when Will was born, in 80s UK, if it would have ever been considered then, but Will was male so there was never any issue. With William and Catherine getting married, and the approaching of a new heir, I believe the gov. wanted to get everything sorted out, just in case. It was announced in 2011, long before Baby George was a twinkle in his daddies eye, and basically because it was an old, outdated law. However it also affects a LOT of other things, not just all the Commonwealth countries but other titles etc. of the nobility, that it hasn't been finalised.
The new law will not however be retro-sepective. It will only begin the day Parliament spoke about it which I believe was 20 something of October 2011. It will affect all babies/births from then.
* James, Viscount Seven is ahead of Lady Louise.
It goes Charles, William, George, Harry, Andrew, Beatrice, Eugenie, Edward, James, Louise, Anne, Peter, Savannah, Isla, Zara, then back up to the Queen's siblings, she only had one, and she's died, so then its her children, and so forth.