Albert Theuwissen is explaining the basics behind the images sensors we use today in our latest mobile phones and camera's.
The sensors get more and more complicated while getting smaller.
One basic technique that has become a standard is to isolate the sensors with deep trenches.
to put the deepness in perspective ; think of a trench of 20cm wide and 40.000km deep...
http://image-sensors-world.blogspot.com/2021/02/albert-theuwissen-delivers-keynote-at.html