The inner workings of a camera are actually super interesting! Here's a really cool animation that shows how a DSLR camera works: https://www.youtube.com/watch?v=W34sLbAsFhM
I have a question why do we need to open and close the censor physically? Why do we not just power on the sensor for a certain amount of time and then close it? It would be more convenient and easy to control I think.