renderStoredEmailTemplate renders a template. In other words, it produces output that would be the email that would be sent to the recipient with all the merge fields merged. This is typically used to provide a "mail preview" without actually sending the message. This replaces the previous "trick" where developers would send the email, then roll it back, just to get a rendered preview.
setWhatId sets the "related to" for the email template. This can be an Account, Opportunity, Case, Custom Object, etc. This allows the email to be related to a type of record, or in other words, what topic the email is regarding. This is optional when emailing Leads and Contacts, and cannot be set when emailing Users.
setTargetObjectId sets the "recipient" for the email template. This is a Lead, Contact, or User. It's the person you're trying to email. The Email field from that record will be used to address the target.
setTemplateId sets the template you'd like to use for the email message. Once sent, merge fields from the "related to" and "recipient" will be merged in place to provide personalized emails.
Sample Code Listing
// Before running this code, create an email template
EmailTemplate template = [SELECT Id FROM EmailTemplate WHERE Name = 'CaseUpdated'];
// Just an example record
Case caseRecord = [SELECT ContactId FROM Case WHERE ContactId <> NULL LIMIT 1];
Messaging.SingleEmailMessage messages = new Messaging.SingleEmailMessage;
Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
// Note: If you need to send multiple emails, add them all to a list and send at the end
// The template to use
// Who we're mailing; the contact related to the case
// The related record we're talking about
// We need to send a list, even if just one message
Realistically, sending emails are incredibly simple. If the documentation doesn't help, try writing a few programs of your own and experiment. There's no code you can write that can cause any permanent damage, so try and experiment.