Whilst that is their primary function, there are some feature overlaps.
In the past, I used Illustrator to edit saved photos/images as I find the Photoshop interface over complex for my purposes.
Photoshop is for editing raster or bitmap images and Illustrator is for vector images. Bitmaps are saved pixel by pixel that's why as the resolution goes high, the file size gets proportionately bigger. Meanwhile, vector images are saved using math formulas and are relatively small in file sizes. When used in a document or web pages, vector images can even be blown up in size without affecting its clarity. However, both apps have overlapping capabilities now. This is just how I understand this and experts may know more.
The only difference in the photoshop and illustrator is that in photoshop, you can just manipulate or edit the pictures, but in illustrator you can draw the images or pictures.