SEO involves optimizing websites and pages to rank higher in organic search results. There are two main types of SEO: on-page optimization which involves optimizing HTML elements like meta tags and content, and off-page optimization which focuses on link building. White hat SEO adheres to search engine guidelines while black hat SEO uses spammy techniques like keyword stuffing or cloaking forbidden by search engines. Key ranking factors include titles, descriptions, backlinks, and keyword optimization.