How does HTTPS work and what makes it secure?

Technical