A respected intelligence officer (military) has speculated that the Obama folks have known about this affair for some time and just held it in their pocket to use for just such an opportunity. Obviously, the timing is more than just a little coincidental.
I buy that assessment, but (being a guy who has never met a conspiracy theory I didn't like), I propose that the general was set up. Suppose this biographer was a plant from the outset? She didn't write the book -- she had a co-writer, whose name is on the cover. Usually, when a VIP "writes" a bio he/she is listed as the author, and the ghost writer may or may not even be acknowledged. If this woman were a real writer, why did she need a co-author?
My guess is that she was a plant ... in just the way the Russians perennially try to get sexy females to sleep with our diplomatic (and intelligence) people both over there and at home. Being a classic military straight arrow, Petraeus fell for it hook, line, and sinker. So now he's sunk.