Here is one way to think about microcontrollers......
Your desktop, smartphone, or laptop computer has a 'brain' which is busy keeping track of the many applications you are using or might use. Many tasks are being managed simlutaneously. A microcontroller is a smaller version of that 'brain' but more importantly it is normally only being asked to run a single program (application) all the time.
Take Away:
Computers are running many tasks simultaneously. Microcontrollers are doing one task.
The first image is the logic board from a Macbook. The 'brain' is the modest rectangle in the middle of the board. The second image is an Arduino board (the Uno) where the 'brain' is the rectangular object in the bottom right.
Macbook Logic Board:
Arduino Board:
Basically everything else on the board connects the 'brain' to the outside world whether that is a keyboard or a garage door opener. The take away for us is that the 'brain' takes up very little space and communication with the 'brain' takes a lot of space (must be a lesson in that somewhere).
Take Away:
The 'brain' takes up very little space and communication with the 'brain' takes a lot of space
There are many objects in our world from our refrigerators to our cars that we want to intelligently perform the same task or set of tasks over and over again. At the heart of most modern machines is a microcontroller managing those tasks. For a refrigerator an Arduino is perfectly capable of executing all the needed tasks. For something more complex like a car the controller is much more like a computer except that it is only performing the same task all the time.
Like us, the microcontroller needs information to guide the performance of it's task. These are called inputs and are electrical information that arrive through the connectors along the edge of the board (inputs). In order to affect the outside world the microcontroller needs to reach out an control things like motors and lights. These are also access through the connectors along the edge (outputs). Collectively the inputs and outputs are called I/O (brilliant eh?)
All we need now is a tool to communicate with the 'brain' and let it know what we want it to do. This tool varies depending on the microcontroller. In general we open an 'editor' (like a word processing program) to create a document in the language (code) of our particular microcontroller. We then connect the 'editor' to the 'brain' and 'load' the document into the 'brain' (it is actually called uploading). When the power is turned on the 'brain' follows the instructions we have given it and life is good.
Take Away:
We create a document (program) that is uploaded to the 'brain'. When there is power to the 'brain' it executes the task as we have directed (and never stops).
Logic Board for Refrigerator: