The higher the octane the fewer double bonds that exhist between carbon molecules in gasoline. Gasoline contains many chemicals that contribute to the way it burns. With respect to damage done to the engine(not environment) the higher the octane the better it is for the engine (assuming any modern performance car). The more double bonds between carbon molecules the more "knocking" you get, that "knocking" can damage an engine over long periods of use. The reason for the "knocking" is due to the physio-chemical properties of gasoline and octane reduces those properties. In short if you have a BMW get the highest octane available. If you want more information about what "knocking" is and how exactly it works with respect to octane you can go to
http://forum.e46fanatics.com/showthread.php?t=161055 and skip to the second to last post or just post here again and i'll try to explain in a different way.