In short, message passing interfaces are one of the popular ways that operating systems work.
Your code, as an application, has 'messages' "rain down" upon it. You get to respond to each message as it comes in.
Messages may be things like startup, shutdown, draw yourself, a timer fired, etc.
Some OS', like DOS, don't use message passing, instead your program assumes overall control of the computer and you demand/ask for information from the system. Console apps often work this way too.
So, a console app might say:
print "What is your name?";
input name;
if (name == "Chainsaw") print "You are a genius!";
whereas a message passing interface would be more like...
<display form>
<wait for messages>
<on edit-box-exit, get edit-box-contents, if contents == "Chainsaw", etc etc etc>
So, message passing interfaces are more involved, but allow multiple processes to share the machine cooperatively.