The basic idea is to create the tree structure through recursion. Start with a trunk and then spawn several branches. At the end of each branch spawn several more branches. Then draw a leaf cluster at the end of each of these branches, including the intermediate ones. A leaf cluster is just a few green circles.
If you want to dig deep into recursion for tree and plant generation, see the book Algorithmic Beauty of Plants [PDF].