HTTPS is just HTTP running inside a TLS-encrypted channel. TLS (Transport Layer Security) gives you three guarantees: confidentiality (traffic is encrypted), integrity (it can't be tampered with undetected), and authentication (you're really talking to the server named in the certificate). It's negotiated in a handshake before any HTTP is sent:
Client Server
│──── ClientHello ──────────────────────▶│ (TLS versions, cipher suites, random)
│◀─── ServerHello + Certificate ─────────│ (chosen cipher + cert with public key)
│ │
│ verify cert against a trusted CA │
│ agree on keys (e.g. ECDHE key exchange)│
│ │
│──── Finished (encrypted) ──────────────▶│
│◀─── Finished (encrypted) ───────────────│
│========= encrypted application data ====│ (now HTTP flows, encrypted)
