Both ancestrally were independent cells that formed a symbiotic relationship with other cells.
Mitochondria and Chloroplast