This is a very loaded question but i'll try to explain it as best I can. Since you listed numerous languages only 1 of which is typically used for server side programing I'm going to try to generaliz the answer. (ASP and PHP are the most common, Perl is another though not a popular, VBScript and Javascript though they have server side capabilities they are typically used for client side programing). When you click the 'submit' button all the data that was entered/selected in the form is sent to the address that is specified in the method property of the form tag. That page reads the data that was sent and is typically validated against some critaria (is it a valid email address, phone number, birthday...) If some data is not valid the form is redisplayed with error messages. If everything is valid the server dopes something with the data, typically putting the data into a database, or e-mailing the data to someone (such as customer service).
Hope that helped
