Why does photosynthesis occur in eukaryotic cells?

In order for photosynthesis to occur, the organelle chloroplast is needed. Eukaryotic cells (typically plants) do contain chloroplasts which the plant can use to make food.

However, there are several prokaryotic organisms such as the purple bacteria that contains a different kind of chlorophyll and can photosynthesize.