On the genesis of BBP formulas