HTTPS uses TLS (SSL) to encrypt normal HTTP requests and responses, making it safer and more secure. HTTPS uses the SSL/TLS protocol to encrypt communications so that attackers can't steal data. SSL/TLS also confirms that a website server is who it says it is, preventing impersonations. (Hence prevents attacks like domain spoofing )This stops multiple kinds of cyber attacks. To understand how https works it is vital to understand two key concepts of Public-key cryptography, or asymmetric cryptography. Encryption and signing.
 

Basics of public key cryptography

What happens in a https request response?

 

 

Read more

https://www.cloudflare.com/en-in/learning/ssl/what-is-domain-spoofing/