What happens when someone fills in a contact form on a website?

I am trying to debug a problem on a website I am working on. The contact form doesn’t work. In my quest to find answers it occurred to me that I don’t even actually know what’s going on in the background in order to understand the sites that I’m reading for help!

So basically my question is: what happens when someone submits a form on a website?

I see that my hosting company has provided me a mail box with some arbitrary email address where the form submission gets returned to when it fails. Why? Do all form submissions actually come from this email address? What does PHP or SMTP have to do with this?