As avocados ripen, they release a gas called ethylene, created when starch begins to convert into sugar, which facilitates the ripening process. Ethylene is also given off by various other fruits including bananas and apples - this means that, if you put an avocado in a bag with another ethylene producing fruit, you can accelerate its ripening.
In terms of its composition, the avocado consists mainly of fatty acids such as oleic acid and linoleic acid, shown below.
Avocados turn brown as they react with oxygen in the air. This is because one of the enzymes they contain, called polyphenol oxidase, polymerises compounds in the avocado to produce polyphenols, which manifest as brown colouration.